systemctl status docker
systemctl start docker
systemctl restart docker
systemctl stop docker
systemctl enable docker
systemctl disable docker
docker version -f [输出格式]
示例:
docker version
docker version -f json
docker info -f [输出格式]
示例:
docker info
docker info -f json
docker login -u [用户名] -p [密码] [仓库地址]
示例:
docker login -u test -p 123456 hub.hty1024.com
docker logout [仓库地址]
示例:
docker logout hub.hty1024.com
docker images
docker image ls
docker inspect [镜像]
示例:
docker inspect opensuse/leap:15.6
docker history [镜像]
示例:
docker history opensuse/leap:15.6
docker search [关键词]
示例:
docker search opensuse
docker pull [镜像]
docker image pull [镜像]
示例:
docker pull opensuse/leap:15.6
docker push [镜像]
示例:
docker push opensuse/leap:15.6
docker save -o [输出文件] [镜像(多个时用空格隔开)]
示例:
docker save -o opensuse_leap_15.6.tar opensuse/leap:15.6
docker load -i [输入文件]
示例:
docker load -i opensuse_leap_15.6.tar
docker build [参数] -t [镜像] [工作目录]
示例:
docker build --no-cache -t opensuse/leap:15.6 .
docker ps [参数]
示例:
docker ps
docker ps -a
docker inspect [参数] [容器]
示例:
docker inspect opensuse
docker inspect -s opensuse
docker stats [参数] [容器]
示例:
docker stats -a
docker stats opensuse
docker stats opensuse --format json
docker top [容器]
示例:
docker top opensuse
docker logs [参数] [容器]
示例:
docker logs opensuse
docker logs opensuse -n 100
docker logs opensuse -f
docker logs opensuse -t
docker run [参数] [镜像] [命令]
示例:
docker run -d opensuse/leap:15.6
docker start [参数] [容器(多个时用空格隔开)]
示例:
docker start opensuse
docker stop [参数] [容器(多个时用空格隔开)]
示例:
docker stop opensuse
docker restart [参数] [容器(多个时用空格隔开)]
示例:
docker restart opensuse
docker kill [参数] [容器(多个时用空格隔开)]
示例:
docker kill opensuse
docker cp [参数] [容器]:[容器内文件] [宿主机目录]
示例:
docker cp opensuse:/etc/os-release ./
docker cp [参数] [宿主机目录] [容器]:[容器内文件]
示例:
docker cp ./test.txt opensuse:/tmp