一、存储驱动错误

问题:

[root@xiaoqiang docker]# docker run hello-world
docker: Error response from daemon: error creating aufs mount to /var/lib/docker/aufs/mnt/9f1cc4ec95241a1432a23f4ee7a1eb1c3fcf239ad203f915668967685ded08c4-init: invalid argument.
See 'docker run --help'.

解决:

# 修改存储类型
vim /etc/docker/daemon.json
{"storage-driver": "vfs","registry-mirrors": ["https://v8o5rqy6.mirror.aliyuncs.com"]
}
# 重启docker服务
systemctl daemon-reload && systemctl restart docker
# 查看docker信息
[root@xiaoqiang docker]# docker info
Containers: 0Running: 0Paused: 0Stopped: 0
Images: 0
Server Version: 18.06.1-ce
# aufs修改成vfs
Storage Driver: vfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:Volume: localNetwork: bridge host macvlan null overlayLog: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:seccompProfile: default
Kernel Version: 4.15.0-111-generic
Operating System: CentOS Linux 7 (Core) (containerized)
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 1GiB
Name: xiaoqiang
ID: RWVR:PMVN:RXON:OQ5H:RNFU:MNWE:JVVZ:D76W:MIYT:YL2L:DPEI:LC7V
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:127.0.0.0/8
Live Restore Enabled: falseWARNING: No swap limit support
# 运行成功
[root@xiaoqiang docker]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:4cf9c47f86df71d48364001ede3a4fcd85ae80ce02ebad74156906caff5378bc
Status: Downloaded newer image for hello-world:latestHello from Docker!
This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.2. The Docker daemon pulled the "hello-world" image from the Docker Hub.(amd64)3. The Docker daemon created a new container from that image which runs theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID:https://hub.docker.com/For more examples and ideas, visit:https://docs.docker.com/get-started/
# 存储类型有
|Storage driver |Must match backing filesystem |
|---------------|------------------------------|
|overlay        |No                            |
|aufs           |No                            |
|btrfs          |Yes                           |
|devicemapper   |No                            |
|vfs            |No                            |
|zfs            |Yes                           |

二、启动权限不够

问题:

operation not permitted
[root@xiaoqiang nacos]# ls
data  docker-compose.yaml
[root@xiaoqiang nacos]# docker-compose up
Starting nacos ... errorERROR: for nacos  Cannot start service nacos: OCI runtime create failed: container_linux.go:348: starting container process caused "operation not permitted": unknownERROR: for nacos  Cannot start service nacos: OCI runtime create failed: container_linux.go:348: starting container process caused "operation not permitted": unknown
ERROR: Encountered errors while bringing up the project.

解决:

去掉privileged或者加上privileged

三、服务启动超时

问题:

root@xiaoqiangzai:/home/qiang/docker-compose/nacos[root@xiaoqiangzai nacos]# docker-compose up -d && docker logs -f nacos
Creating network "nacos_default" with the default driver
Creating nacos ... ERROR: for nacos  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)ERROR: for nacos  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

解决:

vim /etc/profile
export COMPOSE_HTTP_TIMEOUT=500
export DOCKER_CLIENT_TIMEOUT=500
source /etc/profile

四、登录界面重叠

问题:

引起这个问题的原因是在使用"docker run"运行容器时使用了 “/sbin/init"和”–privileged"参数。使用/sbin/init启动容器并加上–privileged参数,相当于docker容器获得了宿主机的全权委托权限。这时docker容器内部的init与宿主机的init产生了混淆。

解决:

systemctl status getty@tty1.service
systemctl stop getty@tty1.service
systemctl disable getty@tty1.service

作者(Author):小强崽
来源(Source):https://www.wuduoqiang.com/archives/Docker常见错误
协议(License):署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
版权(Copyright):商业转载请联系作者获得授权,非商业转载请注明出处。 For commercial use, please contact the author for authorization. For non-commercial use, please indicate the source.

Docker常见错误相关推荐

  1. 记录windows下docker常见错误与解决办法

    在启动之前创建的容器时,发现出现下面的问题: OCI runtime create failed: container_linux.go:380: starting container process ...

  2. K8S常见错误、原因及处理方法

    OOMKilled: Pod 的内存使用超出了 resources.limits 中的限制,被强制杀死. CrashLoopBackoff: Pod 进入 崩溃-重启循环,重启间隔时间从 10 20 ...

  3. Docker 常见使用

    目录 1. Docker 常见使用 1.1. docker 常用命令 1.2. 网络 / 网卡 1.2.1. 查看 docker 容器 IP 地址 1.2.2. 删除多余网卡 1.2.3. 删除 `d ...

  4. Go十大常见错误第7篇:不使用-race选项做并发竞争检测

    前言 这是Go十大常见错误系列的第7篇:不使用-race选项做并发竞争检测.素材来源于Go布道者,现Docker公司资深工程师Teiva Harsanyi. 本文涉及的源代码全部开源在:Go十大常见错 ...

  5. Go常见错误第14篇:过度使用getter和setter方法

    前言 这是Go常见错误系列的第14篇:过度使用getter和setter方法. 素材来源于Go布道者,现Docker公司资深工程师Teiva Harsanyi. 本文涉及的源代码全部开源在:Go常见错 ...

  6. Go常见错误第11篇:意外的变量隐藏(variable shadowing)

    前言 这是Go常见错误系列的第11篇:Go语言中意外的变量遮蔽.素材来源于Go布道者,现Docker公司资深工程师Teiva Harsanyi. 本文涉及的源代码全部开源在:Go常见错误源代码,欢迎大 ...

  7. Golang 要注意的陷阱和常见错误

    原文: 50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs 翻译: Go的50度灰:新Golang开发者要 ...

  8. Python运行的17个时新手常见错误小结

    Python运行的17个时新手常见错误小结 1 发布时间:『 2017-11-04 11:20 』     帖子类别:『人工智能』  阅读次数:8803 (本文『Python运行的17个时新手常见错误 ...

  9. 极客新闻——16、数据库设计中的5个常见错误

    本文笔记全部来自<极客新闻>--新鲜的技术资讯.权威的趋势剖析.别样的技术洞察 本文作者总结了数据库设计中的5个常见错误,以供开发人员参考. 1.糟糕的预规划 好的数据库是深思熟虑的结果, ...

  10. 构建微服务时的三大常见错误

      来自:分布式实验室 公众号,作者:解博 想在网上挨骂,最简单的方法就是写点关于微服务架构的东西.每个人对微服务都有自己的一套见解:无论我们是赞扬还是批评,总会有人跳出来强调"你错了&qu ...

最新文章

  1. 被大众群体吹的神乎其神的Python到底都能干什么
  2. 为提高能量利用效率,大脑会对感官进行预测
  3. servlet 认证,授权
  4. KindEditor 4 输入框限定字数
  5. easyui 通用的datagrid中如何带有查询条件分页
  6. 数据结构--链式线性表
  7. mysql取消操作系统_Linux下的MySQL简单操作(服务启动与关闭、启动与关闭、查看版本)...
  8. 返回值带头信息 php_php与Redis实现分布式锁
  9. java的编程规范_JAVA编程规范-OOP规范
  10. Ubuntu 16 安装JDK1.8
  11. 计算机睡眠与切换用户的区别,小白教你电脑休眠和睡眠的区别
  12. 每天一篇自然语言处理论文:202004
  13. 什么是闭包 以及使用场景
  14. 爬取《战狼2》电影短评论,生成图云
  15. 实践项目一 项目开发团队分配管理
  16. Apktool工具 - 反编译apk和重新编译apk
  17. ssl模拟赛(2019.4.27)
  18. 网络教学c语言,本体C语言网络教学模式
  19. 新浪微博营销应该怎么去做才好呢?
  20. 使用python + Fiddler爬取抖音用户下所有视频

热门文章

  1. scikit-learn 线性回归算法库小结
  2. android ipad 播放器,[AS3]专业级跨平台网页播放器支持PC、iPad、iPhone、Android系统...
  3. 系统流程图、数据流程图、IPO图和甘特图
  4. java guardedby_Oracle官方并发教程之Guarded Blocks
  5. git glo_TWOdW,2011年8月31日:作者,演讲者,开发商Andy Glover
  6. android七牛云存储,使用七牛云存储上传android本地视频并播放
  7. gc算法 java_Java的GC机制及算法
  8. 蓝桥杯--第七届决赛:圆圈舞
  9. bzoj5442: [Ceoi2018]Global warming
  10. Rails——migration