基本设置
1 | # 启动 Docker |
操作
- Docker 删除所有无名称的镜像(悬空镜像)
1 | docker rmi $(docker images -f "dangling=true" -q) |
进入容器
1 | docker exec -it CONTAINER_ID /bin/bash |
nsenter
1 | wget https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.33/util-linux-2.33-rc1.tar.gz |
1 | # 查看 CONTAINER_ID |
查看日志
1 | docker logs -f -t --tail 行数 容器名 |
免 sudo
1 | sudo gpasswd -a ${USER} docker |
问题
IPv4 forwarding is disabled. Networking will not work.1
2echo 'net.ipv4.ip_forward=1' >> /usr/lib/sysctl.d/00-system.conf
systemctl restart network && systemctl restart docker