国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Web服務器 > 正文

docker 容器上編譯 go 程序提示找不到文件問題

2024-09-01 13:54:56
字體:
來源:轉載
供稿:網友

dockerfile

[root@SZB-L0010091 zxg]# cat DockerfileFROM scratchCOPY webdemo /EXPOSE 9999CMD ["/webdemo"]

docker run 報錯信息:

[root@zxg]# docker run --rm -it -p 9999:9999 web:1.0panic: standard_init_linux.go:178: exec user process caused "no such file or directory" [recovered]  panic: standard_init_linux.go:178: exec user process caused "no such file or directory"goroutine 1 [running, locked to thread]:panic(0x6f2340, 0xc420132620)  /usr/lib/golang/src/runtime/panic.go:500 +0x1a1github.com/urfave/cli.HandleAction.func1(0xc420091748)  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/Godeps/_workspace/src/github.com/urfave/cli/app.go:478 +0x247panic(0x6f2340, 0xc420132620)  /usr/lib/golang/src/runtime/panic.go:458 +0x243github.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization.func1(0xc420091198, 0xc42001e050, 0xc420091238)  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:259 +0x18fgithub.com/opencontainers/runc/libcontainer.(*LinuxFactory).StartInitialization(0xc42004efa0, 0xaab9c0, 0xc420132620)  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/Godeps/_workspace/src/github.com/opencontainers/runc/libcontainer/factory_linux.go:277 +0x353main.glob..func8(0xc4200ba3c0, 0x0, 0x0)  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/main_unix.go:26 +0x66reflect.Value.call(0x6dd0c0, 0x768ec8, 0x13, 0x73b509, 0x4, 0xc420091708, 0x1, 0x1, 0x4d17a8, 0x731360, ...)  /usr/lib/golang/src/reflect/value.go:434 +0x5c8reflect.Value.Call(0x6dd0c0, 0x768ec8, 0x13, 0xc420091708, 0x1, 0x1, 0xac1700, 0xc4200916e8, 0x4da786)  /usr/lib/golang/src/reflect/value.go:302 +0xa4github.com/urfave/cli.HandleAction(0x6dd0c0, 0x768ec8, 0xc4200ba3c0, 0x0, 0x0)  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/Godeps/_workspace/src/github.com/urfave/cli/app.go:487 +0x1e0github.com/urfave/cli.Command.Run(0x73b6d5, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x74cc8a, 0x51, 0x0, ...)  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/Godeps/_workspace/src/github.com/urfave/cli/command.go:191 +0xc3bgithub.com/urfave/cli.(*App).Run(0xc4200cc000, 0xc420064060, 0x2, 0x2, 0x0, 0x0)  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/Godeps/_workspace/src/github.com/urfave/cli/app.go:240 +0x611main.main()  /builddir/build/BUILD/docker-1398f249013601ab999d286910664d70fd1329a2/runc-f5721697226d42d9efeea37fa3a7eb1d208fa1a2/main.go:137 +0xbd6

解決辦法:增加-tags netgo選項編譯

GOOS=linux GOARCH=amd64 go build -tags netgo -o rollingupdate${TAG} main.go

總結

以上所述是小編給大家介紹的好的docker 容器上編譯 go 程序無法運行提示找不到文件問題,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VEVB武林網網站的支持!


注:相關教程知識閱讀請移步到服務器教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 客服| 象山县| 绵竹市| 伊吾县| 靖宇县| 通州区| 台江县| 丹阳市| 绵阳市| 紫阳县| 明星| 台北市| 南投市| 新竹市| 门源| 金华市| 工布江达县| 体育| 华坪县| 新兴县| 定兴县| 揭东县| 镇原县| 湖州市| 邹城市| 东城区| 获嘉县| 腾冲县| 信丰县| 通州市| 金坛市| 长寿区| 蒲城县| 定远县| 乐清市| 沅江市| 临城县| 丹阳市| 正阳县| 长岛县| 铜陵市|