Skip to content

feat: 'make multi' to build and push multiarch docker image with arm64,amd64,arm archs#16

Open
muravjov wants to merge 1 commit intobrancz:masterfrom
muravjov:master
Open

feat: 'make multi' to build and push multiarch docker image with arm64,amd64,arm archs#16
muravjov wants to merge 1 commit intobrancz:masterfrom
muravjov:master

Conversation

@muravjov
Copy link
Copy Markdown

Hi, thanks for your work.

I use arm64 based k8s and following the tutorial at https://prometheus-operator.dev/docs/developer/getting-started/#deploying-a-sample-application

I got an issue that the image in question cannot be run on my node because:

$ kubectl logs deployments/example-app --all-pods --prefix -f
[pod/example-app-5ffc85cf6d-96r92/example-app] exec /bin/prometheus-example-app: exec format error
[pod/example-app-5ffc85cf6d-98r8x/example-app] exec /bin/prometheus-example-app: exec format error
[pod/example-app-5ffc85cf6d-vkv96/example-app] exec /bin/prometheus-example-app: exec format error

This patch intoduces a new Makefile multi which builds and pushes a multiarch image to quay.io/brancz/prometheus-example-app:v0.5.0 .
If you want to test it locally without pushing, run make multi with this patch:

$ git diff
diff --git a/Makefile b/Makefile
index e2970a9..a2ecd85 100644
--- a/Makefile
+++ b/Makefile
@@ -9,4 +9,4 @@ all: build
        docker build -t quay.io/brancz/prometheus-example-app:$(VERSION) .

 multi: build
-       docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t quay.io/brancz/prometheus-example-app:$(VERSION) .
+       docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t quay.io/brancz/prometheus-example-app:$(VERSION) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant