Docker常用命令
Docker 如何查看容器IP地址
docker exec -it ID/NAMES ip addr
查看Docker的底层信息,里面也有ip相关
docker inspect ID/NAMES
进入容器
docker exec -ti ID/NAMES bash
#将容器中的文件拷贝出来
docker cp test_con:/etc/apt/sources.list /tmp/sources.list
#将容器中的文件拷贝回去
sudo docker cp /tmp/sources.list test_con:/etc/apt/
Debian更换国内源
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib deb http://mirrors.aliyun.com/debian-security buster/updates main deb-src http://mirrors.aliyun.com/debian-security buster/updates main deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
清华大学镜像站
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
#Docker 查看容器映射的目录
#Docker 如何查看容器的挂载映射目录
docker inspect container_name | grep Mounts -A 20