docker使用
1、docker系统:Debian GNU/Linux 11 cat /etc/issue
2、apt-get更改国内安装源:以下是debian系统的,区别ubuntu
deb http://mirrors.ustc.edu.cn/debian/ buster main deb-src http://mirrors.ustc.edu.cn/debian/ buster main deb http://security.debian.org/debian-security buster/updates main deb-src http://security.debian.org/debian-security buster/updates main # buster-updates, previously known as 'volatile' deb http://mirrors.ustc.edu.cn/debian/ buster-updates main deb-src http://mirrors.ustc.edu.cn/debian/ buster-updates main deb http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib deb-src http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib
3、列出镜像、容器
docker images docker ps -a docker ps -al
3、启动、停止一个docker的容器
docker container stop 容器名或容器id docker container start 容器名或容器id
docker stop containerId // containerId 是容器的ID
docker ps -a // 查看所有容器 $ docker ps -a -q // 查看所有容器ID
//必须要terminal终端执行
docker stop $(docker ps -a -q) // stop停止所有容器
docker rm $(docker ps -a -q) // remove删除所有容器
4、进入已启动容器bash界面
docker start ID
docker exec -it 容器id /bin/bash