docker使用指南&疑难杂症

使用指南

一 常见命令

二 非常见情况

1 构建包不成功留下一堆废镜像和容器<none>如何清理?

https://blog.csdn.net/catoop/article/details/91908719

2 docker0 ip没了怎么办?

容器stop(不确定是否必须,关上保险),重启docker,再start容器

service docker restart

疑难杂症

1 non-zero code: 100

问题:Dockerfile构建镜像,旧文件一点没动,结果执行到apt各种包会报找不到。returned a non-zero code: 100

W: Failed to fetch http://mirrors.163.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'mirrors.163.com'
W: Failed to fetch http://mirrors.163.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'mirrors.163.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package net-tools

The command '/bin/sh -c apt-get update &&    apt-get install net-tools -y &&    apt-get install iputils-ping -y &&    apt-get install vim -y &&    apt-get autoclean &&    apt-get autoremove' returned a non-zero code: 100

而且直接ping mirrors.163.com是通的。

解决:都说换源,对我一点用都不管。最后是这个起作用了。
可能是docker的dns有问题。https://zhuanlan.zhihu.com/p/422089996

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值