dongzi3434 2018-05-22 01:25
浏览 283

standard_init_linux.go:185:exec用户进程导致“无此文件或目录”构建docker映像

I am trying to generate a docker image based on a binary of Go. I have the next Dockerfile:

FROM alpine

WORKDIR /

# Now just add the binary
RUN apk add --update bash && rm -rf /var/cache/apk/*
ADD mybinary /
ADD config /config
ADD data /data

ENTRYPOINT ["./mybinary"]

And I built the binary by doing:

env GOOS=linux GOARCH=386 CGO_ENABLED=1 go build -o mybinary

The binary works pretty good if I executed alone, and the docker image is created as well, but in the moment of execution then I get the error:

 standard_init_linux.go:185: exec user process caused "no such file or directory"

I read in many post that it's something regarding git, so, I deleted and cloned the project again but still I get the same error

  • 写回答

1条回答 默认 最新

  • doujiexin1136 2018-05-22 02:18
    关注

    Your docker image starts from alpine linux dstro. Hence you should use a supported cpu architecture

    GOARCH=amd64 instead of GOARCH=386.

    You can see other supported architectures here. https://hub.docker.com/r/library/alpine/

    Links to the alpine docker images of other architectures can be found here https://github.com/docker-library/official-images#architectures-other-than-amd64

    评论

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答