dongnaoxia0927 2016-12-10 01:33
浏览 1139

错误:fork / exec:没有这样的文件或目录—在docker中运行Golang代码时

first of all any help is appreciated

I want execute Gocode in a container, but when I try and execute in a container I get the following error:

[root@ping-app-3618687774-abqmo ping-app]# go run main.go 
start check_server
INFO[0000] http.startHttpServer ok, listening 0.0.0.0:8080  source="api.go:106"
INFO[0000] Index=ipdata exists=true                      source="elastic.go:164"
INFO[0000] Index=ipdata Type=entity exists=true          source="elastic.go:184"
fork/exec : no such file or directory
fork/exec : no such file or directory
fork/exec : no such file or directory
fork/exec : no such file or directory
fork/exec : no such file or directory
fork/exec : no such file or directory
fork/exec : no such file or directory
fork/exec : no such file or directory

I can't understand why this is happening and it only happened in docker, but when I run that Gocode on the host and it is ok.

Environment :

Centos: 7.0.1406

Kubernetes: 1.2.0

docker: 1.10.3

Thanks a lot for any suggestions.

  • 写回答

2条回答 默认 最新

  • 普通网友 2016-12-10 09:25
    关注

    in your dockerfile you should also copy fork/exec. in your go code you are reading from fork/exec and it is not found inside the container so it results in this error.

    评论

报告相同问题?

悬赏问题

  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥15 python天天向上类似问题,但没有清零
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 C#调用python代码(python带有库)
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)