Crossbuilding docker image for different architectures
See original GitHub issueContent & configuration
Docker image should work on most common processor architectures.
Is your feature request related to a problem?
The image only works on the architecture with which it was built. Now docker image only works on x86-64 (maybe only x64). Docker image not working on Raspberry PI at least.
➜ ~ arch
armv7l
➜ ~ docker run -it swaggerapi/swagger-ui sh
standard_init_linux.go:211: exec user process caused "exec format error"
➜ ~ arch
x86_64
➜ ~ docker run -it swaggerapi/swagger-ui sh -c "echo 'works well'"
works well
Describe the solution you’d like
Something like
docker buildx build \
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x \
--output "type=image,push=false" \
--file ./Dockerfile \
--pull \
--tag swaggerapi/swagger-ui:latest \
.
Describe alternatives you’ve considered
https://docs.docker.com/engine/reference/commandline/manifest_create/
Additional context
docker buildx imagetools inspect nginx:1.17-alpine
Base image works on linux/amd64, linux/arm/v6, linux/arm64/v8, linux/386, linux/ppc64le, linux/s390x.
Swagger UI image not event annotated
docker buildx imagetools inspect swaggerapi/swagger-ui
Issue Analytics
- State:
- Created 4 years ago
- Reactions:19
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Multi-arch build and images, the simple way
The question is now, how can we put multiple Docker images, each supporting a different architecture, behind the sametag?
Read more >Cross building ARM images on Docker Desktop
Now it's possible to cross-build Docker images for multiple architectures using Docker Desktop. Docker desktop is currently the best option for developers to ......
Read more >Cross Building and Running Multi-Arch Docker Images
Cross-building is defined as building a foreign architecture image different from the hosts architecture, such as building a armhf image on ...
Read more >Cross build your docker images
Using a stage in Dockerfile to cross-compile to different architectures. We'll focus on the first option, cross building with emulation. docker ...
Read more >Building Windows multi-arch container images on Linux
All other instructions can be used like normally. Most Dockerfiles for Windows images can be refactored to benefit from cross-building. The idea ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wrote Github Actions pipeline for crossbuilding swagger-ui image to 386, amd64, arm/v6, arm/v7, arm64, s390x architectures. https://github.com/Pentusha/swagger-ui/blob/master/.github/workflows/docker_crossbuild.yml It publish result images to Docker Hub: https://hub.docker.com/repository/docker/pentusha/swagger-ui-crossbuild/general Its works fine on my raspberry pi 4.
Maybe you could include this build steps to your Jenkins pipelines.
Really love to see linux arm64 support. Since I am using an M1 macbook.