Skip to content

Instantly share code, notes, and snippets.

@lg
Created July 23, 2022 16:18
Show Gist options
  • Save lg/da4d0029b25ef6c7b1d1b808e271988a to your computer and use it in GitHub Desktop.
Save lg/da4d0029b25ef6c7b1d1b808e271988a to your computer and use it in GitHub Desktop.
Skaffold multi-platform / multi-architecture builds using docker + buildx and a custom buildCommand
apiVersion: skaffold/v2beta28
kind: Config
metadata:
name: abcdef
build:
artifacts:
- image: ghcr.io/lg/abcdef
custom:
buildCommand: | # build for multiple platforms
if ! docker buildx inspect skaffold-builder >/dev/null 2>&1; then docker buildx create --name skaffold-builder --platform $PLATFORMS; fi
docker buildx build --builder skaffold-builder --platform $PLATFORMS -t $IMAGE $($PUSH_IMAGE && echo '--push') "$BUILD_CONTEXT"
platforms: ["linux/amd64", "linux/arm64"]
tagPolicy:
sha256: {}
deploy:
kubectl:
manifests:
- some-kubernetes-file.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment