You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document Docker build for cross platform images (e.g build on macOS and deploy to amd64) #43
At Anomaly we primarily use macOS for development and as Apple moves to Apple Silicon the development environments are moving to arm based CPUs, but most of our deployments are still under amd64 (Intel or AMD based CPUs).
This has caused issues in the past, this should be documented properly and possibly even be made into a Task endpoint
changed the title [-]Document Docker build for cross platform[/-][+]Document Docker build for cross platform images (e.g build on macOS and deploy to amd64)[/+]on Sep 13, 2022
I came across this issue yesterday, I was building fine and then was unable to this week with the no match error messages showing up when it tried to export the image
------
> exporting to image:
------
ERROR: failed to solve: no match for platform in manifest sha256:30c8...: not found`
I tried almost everything that I could find around the web including what has been mentioned in this ticket.
I am on an Apple Silicon M2 machine and my deployment targer is linux/amd64
This Stackoverflow post highlights the use of the --entrypoint flag to mount a shell in interactive mode, which overrides the default entrypoint.
docker run -it --entrypoint sh image_name
This was very useful when debugging why the labs server image worked in development using compose but failed to work when I built and published the image to the Github container repository.
Activity
[-]Document Docker build for cross platform[/-][+]Document Docker build for cross platform images (e.g build on macOS and deploy to amd64)[/+]devraj commentedon May 20, 2023
I came across this issue yesterday, I was building fine and then was unable to this week with the
no matcherror messages showing up when it tried to export the imageI tried almost everything that I could find around the web including what has been mentioned in this ticket.
I am on an Apple Silicon M2 machine and my deployment targer is
linux/amd64Eventually I came across this article Faster Multi-Platform Builds: Dockerfile Cross-Compilation Guide which outlines that
buildxis the way to go when support multiple architectures and mentionsGraviton2CPUs on AWS.I also saw that
Mobywas updates in v4.19 of Docker desktopEventually this is what worked for me.
Hope this helps someone out there struggling with the same issue.
See also M1 mac: docker build allows platform "amd64" but docker run can't find images unless platform is "linux/amd64" where I have left this comment, that issue also references containerd-integration: cannot interact with images that don't have the default platform
devraj commentedon May 20, 2023
Reopening until this is merged into documentation.
devraj commentedon Jun 20, 2023
This Stackoverflow post highlights the use of the
--entrypointflag to mount a shell in interactive mode, which overrides the defaultentrypoint.This was very useful when debugging why the labs server image worked in development using
composebut failed to work when I built and published the image to the Github container repository.fix: path mount which prevented built image from running
refactor: build command for cross platform images REFS #43