docker run hello时出现错误
来源:3-3 DIY一个Base Image
心恋free
2018-11-13
在linux虚拟机和mac上都有如下报错,standard_init_linux.go:190: exec user process caused "exec format error"
mac:
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:21:31 2018
OS/Arch: darwin/amd64
Experimental: false
Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:29:02 2018
OS/Arch: linux/amd64
Experimental: true
linux虚拟:
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:48:22 2018
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:19:08 2018
OS/Arch: linux/amd64
Experimental: false
1回答
-
心恋free
提问者
2018-11-13
已经解决了,我用的golang创建的hello程序,hello文件生成的时候依赖的一些库动态链接的,但是scratch 镜像完全是空的,什么东西也不包含,编译hello时候要按照下面的方式生成,使生成的hello静态链接所有的库:
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o hello .
122019-02-07
相似问题