Created
July 23, 2022 16:18
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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