Conversation
To be able build not only amd64 images we need to support golang downloading for proper architecture. Example: docker buildx build --platform=linux/arm64 -t sameersbn/gitlab .
There was a problem hiding this comment.
Short and smart code. I like it. Thank you for your contribution.
For your information:
-
There is a concurrent work #2732 .
-
From man page of
dpkg-architecture(1):In any case, you should never use dpkg --print-architecture to get architecture
information during a package build.What do you think about it? If you plan to use dpkg, the document seems to recommend using
dpkg-architecture -qDEB_HOST_ARCH. Also, We must ensure that the output ofdpkg-architecturematches the architecture name used in golang archive filenames.
|
Thank you for detail answer. BTW I checked only arm64/amd64 builds. If you are going to support other architectures for all binaries in Dockerfile , for sure we should check golang binaries (and other (!) binaries), for golang list is there https://storage.googleapis.com/golang/, for example I see that |
|
So I will adjust PR from to and that's all. It still will support arm64/amd64, but other architectures should be adjusted additionally (and other binaries, starting from basic ubuntu image architecture list support). |
|
updated as mentioned, checked by |
|
Hello, ~$ docker buildx create --use
~$ docker buildx build --platform=linux/amd64,linux/arm64 --cache-from sameersbn/gitlab -t sameersbn/gitlab:16.4.1 .But improvements are needed for the arm, because now it gives an error: |
|
So it looks like a need to write patches that update the CGO flags in GoLang to set the reight flags for compilation for arm64 |
|
To be able build not only amd64 images we need to support golang downloading for proper architecture.
Example:
docker buildx build --platform=linux/arm64 -t sameersbn/gitlab .
You can even adjust (in future) your automation builds to push multiarch builds to your docker registries. This is buildkit docker feature OOTB.
Example:
docker buildx build --platform=linux/arm64,linux/arm64 -t <repo tag> --push .
To speedup build you can use previous build as cache
docker buildx build --platform=linux/arm64,linux/arm64 --cache-from <prev build tag> -t <new tag> --push .
and so on.