golang 环境bash 以及shell

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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_37355951/article/details/80034010

 

 

概述:主要记录在使用docker遇到问题,综合网上找的。

1、Dockerfile构建问题

1.1、debconf: unable to initialize frontend: Dialog

原因是在使用apt-get安装依赖时,可能会有对话框,制作镜像时如果不选择会导致失败,解决办法也很简单 
在docker file中增加一句:

ENV DEBIAN_FRONTEND noninteractive

参考:详情

1.2、invoke-rc.d: policy-rc.d denied execution of start

在docker file 中添加一句:

RUN echo “#!/bin/sh\nexit 0” > /usr/sbin/policy-rc.d

参考: 
1、Docker 使用ubuntu容器时,安装包包错:invoke-rc.d: policy-rc.d denied execution of start 
2、How to solve “invoke-rc.d: policy-rc.d denied execution of start.” when building a container Ubuntu 14.04 and installing apache2?

2、启动容器阶段

2.1、standard_init_linux.go:178: exec user process caused “no such file or directory”

这个问题有点尴尬 
第一步如何看启动容器日志: 
$ sudo docker logs -f -t 容器名 
参考: 
Docker看容器启动日志 
解决方法: 
就是头部写错了 
把#!/bint/bash 改为 #!/bin/bash 需要重新构建build (刚开始以为#这是一行注释,其实这是采用哪种脚本来解释,还有一种是/bin/sh) 
以后还是不要惯性思维,你认为并不是你本来的样子 
参考: 
1、自定义容器启动脚本报错:exec user process caused “no such file or directory” 
2、Getting panic: spanic: standard_init_linux.go:178: exec user process caused no such file or directory” while running the docker imag

 
posted @ 2018-09-19 13:37  割肉机  阅读(1238)  评论(0编辑  收藏  举报