1. 程式人生 > >golang 環境bash 以及shell

golang 環境bash 以及shell

sdn 安裝包 啟動腳本 .net conf net execution end init

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

2018年04月21日 21:50:10 往前的娘娘 閱讀數:1010 標簽: docker 異常 啟動 容器 鏡像 個人分類: Docker 版權聲明:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/m0_37355951/article/details/80034010

    • 1、Dockerfile構建問題
      • 1.1、debconf: unable to initialize frontend: Dialog
      • 1.2、invoke-rc.d: policy-rc.d denied execution of start
    • 2、啟動容器階段
      • 2.1、standard_init_linux.go:178: exec user process caused “no such file or directory”

概述:主要記錄在使用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

golang 環境bash 以及shell