Use MAC M1 build image to run on Linux and report standard_ init_ linux.go:219: exec user process caused: exec format error
The main reason for this problem is that golang compilation cannot cross platform, that is, different systems or different CPU cores will cause this error. The golang code compiled under Linux arm cannot be run under Linux x86; Similarly, the image of a project with golang code cannot cross platform. The solution is very simple. When building, add the — platform Linux/AMD64 parameter
docker build --platform linux/amd64 -t tag .
Read More:
- [Solved] standard_init_linux.go:190: exec user process caused “exec format error“
- Docker Create tomcat Error standard_init_linux.go:211: exec user process caused “no such file or directory”
- Docker run Error: container_linux.go:235: starting container process caused “process_linux.go:258: appl
- Cannot start container 39f96c64a9c6: [8] System error: exec format error
- [Solved] docker Error response from daemon OCI runtime create failed container_linux.go380
- [Solved] scala Error: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exe
- [Go] Solve the problem of exec: “gcc” executable file not found in %PATH% error when using cgo
- [Solved] Error running ‘go build myfir_go_project‘: Cannot run program
- How to Solve Docker failed to initialize Error
- How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket
- Docker Open Error: Warning: docker.service changed on disk. Run ‘systemctl daemon-reload‘ to reload unit
- How to Solve k8s Nodal issues: /sys/fs/cgroup/memory/docker: no space left on device\““: unknown.
- How to Solve elasticsearch root user start Error
- How to Solve Go Error: concurrent map iteration and map write
- How to Solve Error: avoided redundant navigation to current location: “index/user”
- How to Solve Show() error caused by empty data
- Mac Appium Error: Error executing adb Exec. Original error…
- Kill Tomcat process in windows and Linux environment (solve the problem of other ports being occupied)
- How to Solve Hexo init error: bash: hexo: command not found
- How to Solve NPM run dev error: missing script:dev