Golang Docker Build runs an error after making the input
The problem arises because the environment in which you are compiling is different from the environment in which you are running, and may have dependencies on dynamic libraries
1. By default, go USES static linking and dynamic compilation is used in Docker’s Golang environment.
2. If you want to compile +alpine to deploy with docker, you can do so by disabling cgoCGO_ENABLED=0
.
3. If you want to use cgo, make GCC statically compiled by go build --ldflags "-extldflags -static"
.
Reference: https://yryz.net/post/golang-docker-alpine-start-panic.html
Reproduced in: https://www.cnblogs.com/davygeek/p/10969434.html
Read More:
- standard_init_linux.go:211: exec user process caused “exec format error”
- Docker run failed with the following error in logs, standard_ init_ linux.go:211 : exec user process caused “exec format error“
- Can’t exec “aclocal”: No such file or directory
- gcc: error trying to exec ‘cc1‘: execvp: No such file or directory
- Error running docker container: starting container process caused “exec: \“python\“: executable file
- Error response from daemon: OCI runtime exec failed: exec failed: container_linux.go:345:
- 【linux】error: stdio.h: No such file or directory
- The Linux terminal appears bash: setup.bash : no such file or directory, and. Bashrc file
- Linux has no way to solve bash. / that file or directory
- Linux QT download / usr / include / C + + / 7/ cstdlib:75 : 15: fatal error: stdlib. H: no such file or directory error
- Importerror of [docker] error: libGL.so .1: cannot open shared object file: No such file or directory
- Failed to get D-Bus connection: No such file or directory
- Docker load loading mirror message JSON no such file or directory error
- Solve syntax error: unexpected end of file or /bin/bash^m: bad interpeneter: no match file or directory
- #During OpenGL development, fatal error C1083: can’t open include file: “GL / glut. H”: no such file or directory
- Cannot open include file: ‘io.h‘: No such file or directory
- fatal error: Python.h: No such file or directory
- No code, a solution to the error in the path of reading CSV file by Python: filenotfounderror: [errno 2] no such file or directory: ‘XX. CSV‘
- In VS2010, the compiler cannot open the file “GL / glaux. H”: no such file or directory
- [tools] vscode debug report G + +. Exe no such file or directory fatal error no input files