[关闭]
@aloxc 2019-04-26T13:19:32.000000Z 字数 307 阅读 324

golang程序编译后在dokcer中可能无法允许的解决办法

golang docker


如题,把编译好的二进制通过创建docker镜像的时候放到docker容器中某个目录,docker容器运行后可能会出错提示xx not found的情况,
如果是使用git clone下来的代码请加上参数 --config core.autocrlf=input:
git clone https://github.com/bigchaindb/bigchaindb.git --config core.autocrlf=input
解决办法就是编译go程序的时候指定一个参数-tags netgo

  1. CGO_ENABLED=0
  2. go build -tags netgo
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注