Docker問題日誌--工做中遇到的問題及解決

  1. 啓動Docker容器時遇到錯誤
  • 標籤:
docker, docker run, docker start,
  • 環境:
Docker version 1.12.6, build 1398f24/1.12.6
[root@localhost jenkins]# cat /proc/version
Linux version 3.10.0-514.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Nov 22 16:42:41 UTC 2016
[root@localhost jenkins]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@localhost jenkins]#
我在Share PC上運行Docker, Share PC不能上外網
 
  • 問題描述:
[root@localhost ~]# docker run centos /bin/echo 'Hello World'
container_linux.go:247: starting container process caused "process_linux.go:334: running prestart hook 1 caused \"error running hook: exit status 1, stdout: , stderr: \""
/usr/bin/docker-current: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:334: running prestart hook 1 caused \\\"error running hook: exit status 1, stdout: , stderr: \\\"\"\n".
  • 問題分析:
該問題是因爲設置了Docker代理引發的.
設置Docker代理以下:
# following link is to resolve docker-runc not found issue,proxy is not necessary *#
ln -s /usr/libexec/docker/docker-proxy-current /usr/bin/docker-proxy
ln -s /usr/libexec/docker/docker-runc-current /usr/bin/docker-runc
# 設置代理
sudo HTTP_PROXY=http://135.251.33.16:80 /usr/bin/dockerd --userland-proxy=false &
  • 解決方案:
我嘗試了Disable SELinux
修改配置文件須要重啓機器:
修改/etc/selinux/config 文件
將SELINUX=enforcing改成SELINUX=disabled
不成功.
而後我試圖中止由代理啓動(sudo HTTP_PROXY命令)的docker服務: service docker stop
顯示中止成功,可是實際沒有成功.
最後我重啓Share PC.
重啓後,啓動Docker: service docker start.
就能夠正確運行docker了:
[root@localhost ~]# docker run centos /bin/echo 'Hello World'
Hello World
[root@localhost ~]#
其餘:
我如今擔憂是否是在建立Dockerfile並build時,是否須要
相關文章
相關標籤/搜索