docker配置文件以及各种问题汇总---随笔
2018-01-24 14:11
651 查看
因为对docker了解不是深入(不是开发docker)。但把docker的配置文件研究透彻,会起到“事半功倍”的效果。下面只是随笔记一下,不能成为博客,若以后有深入研究,再详细整理。
【问题集锦】
问题1、一个已经停止的容器,再次启动报Unknown runtime specified docker-runc[root@localhost ~]# docker start 389fcaab1ca4
Error response from daemon: Unknown runtime specified docker-runc
Error: failed to start containers: 389fcaab1ca4
[root@localhost ~]# 解决方法:
[root@localhost containers]# vi /var/lib/docker/containers/容器ID/hostconfig.json
修改里面"Runtime":"docker-runc",修改为"Runtime":"runc"
原因:不详。
【配置集锦】
用户级配置文件:
/etc/docker/daemon.json(没有则自己创建)
daemon.json样例:
{ "api-cors-header": "", "authorization-plugins": [], "bip": "", "bridge": "", /* 指定网桥 */ "cgroup-parent": "", "cluster-store": "", "cluster-store-opts": {}, "cluster-advertise": "", "debug": true, /* 日志级别 如果是true则打印详细日志信息 */ "default-gateway": "", "default-gateway-v6": "", "default-runtime": "runc", "default-ulimits": {}, "disable-legacy-registry": false, "dns": [], "dns-opts": [], "dns-search": [], "exec-opts": [], "exec-root": "", "fixed-cidr": "", "fixed-cidr-v6": "", "graph": "", "group": "", "hosts": [], "icc": false, "insecure-registries": [], "ip": "0.0.0.0", "iptables": false, "ipv6": false, "ip-forward": false, "ip-masq": false, "labels": [], "live-restore": true, "log-driver": "", "log-level": "", "log-opts": {}, "max-concurrent-downloads": 3, "max-concurrent-uploads": 5, "mtu": 0, "oom-score-adjust": -500, "pidfile": "", "raw-logs": false, "registry-mirrors": [], "runtimes": { "runc": { "path": "runc" }, "custom": { "path": "/usr/local/bin/my-runc-replacement", "runtimeArgs": [ "--debug" ] } }, "selinux-enabled": false, "storage-driver": "", "storage-opts": [], "swarm-default-advertise-addr": "", "tls": true, "tlscacert": "", "tlscert": "", "tlskey": "", "tlsverify": true, "userland-proxy": false, "userns-remap": ""}
系统级配置文件:
/lib/systemd/system/docker.service ---> 启动服务脚本:systemctl start docker 命令就是调用此配置文件
【问题集锦】
问题1、一个已经停止的容器,再次启动报Unknown runtime specified docker-runc[root@localhost ~]# docker start 389fcaab1ca4
Error response from daemon: Unknown runtime specified docker-runc
Error: failed to start containers: 389fcaab1ca4
[root@localhost ~]# 解决方法:
[root@localhost containers]# vi /var/lib/docker/containers/容器ID/hostconfig.json
修改里面"Runtime":"docker-runc",修改为"Runtime":"runc"
原因:不详。
【配置集锦】
用户级配置文件:
/etc/docker/daemon.json(没有则自己创建)
daemon.json样例:
{ "api-cors-header": "", "authorization-plugins": [], "bip": "", "bridge": "", /* 指定网桥 */ "cgroup-parent": "", "cluster-store": "", "cluster-store-opts": {}, "cluster-advertise": "", "debug": true, /* 日志级别 如果是true则打印详细日志信息 */ "default-gateway": "", "default-gateway-v6": "", "default-runtime": "runc", "default-ulimits": {}, "disable-legacy-registry": false, "dns": [], "dns-opts": [], "dns-search": [], "exec-opts": [], "exec-root": "", "fixed-cidr": "", "fixed-cidr-v6": "", "graph": "", "group": "", "hosts": [], "icc": false, "insecure-registries": [], "ip": "0.0.0.0", "iptables": false, "ipv6": false, "ip-forward": false, "ip-masq": false, "labels": [], "live-restore": true, "log-driver": "", "log-level": "", "log-opts": {}, "max-concurrent-downloads": 3, "max-concurrent-uploads": 5, "mtu": 0, "oom-score-adjust": -500, "pidfile": "", "raw-logs": false, "registry-mirrors": [], "runtimes": { "runc": { "path": "runc" }, "custom": { "path": "/usr/local/bin/my-runc-replacement", "runtimeArgs": [ "--debug" ] } }, "selinux-enabled": false, "storage-driver": "", "storage-opts": [], "swarm-default-advertise-addr": "", "tls": true, "tlscacert": "", "tlscert": "", "tlskey": "", "tlsverify": true, "userland-proxy": false, "userns-remap": ""}
系统级配置文件:
/lib/systemd/system/docker.service ---> 启动服务脚本:systemctl start docker 命令就是调用此配置文件
相关文章推荐
- 解决log4net独占日志文件的问题以及 log4net的各种输出配置(Appender)
- 解决log4net独占日志文件的问题以及 log4net的各种输出配置(Appender)
- JAVA随笔篇三(读写Properties配置文件以及路径问题详解)
- 解决log4net独占日志文件的问题以及 log4net的各种输出配置(Appender)
- 解决log4net独占日志文件的问题以及 log4net的各种输出配置(Appender)
- VNC XEN 双鼠标问题 以及 使用 virt-manager 工具创建的 Xen 虚拟机配置文件不在 /etc/xen/ 目录中了
- 最近开发用的各种环境配置以及文件
- eclipse android环境配置问题以及解决途径汇总
- Ubuntu下配置Sublime到Dash board 以及 VI/VIM编辑文件时无权限保存的问题
- Linux管理工作,实例讲解工作中使用ssh证书登录的实际流程,讲解ssh证书登录的配置原理,基于配置原理,解决实际工作中,windows下使用SecureCRT证书登录的各种问题,以及实现hadoo
- svn 配置详解,以及各种可能遇到的问题
- 删除配置文件解决OS X各种WiFi无法连接的顽固问题
- MySQL 体系结构以及各种文件类型学习汇总
- 导出为csv文件时的各种中文问题汇总
- 学习ORACLE中关于配置文件的读取和修改心得以及问题
- VNC XEN 双鼠标问题 以及 使用 virt-manager 工具创建的 Xen 虚拟机配置文件不在 /etc/xen/ 目录中了
- MyEclipse配置刚刚文件问题汇总
- Struts2的result中各种type类型以及配置文件的一些细节
- svn 配置详解,以及各种可能遇到的问题