Docker常用命令整理
· 阅读需 9 分钟
Docker常用镜像和容器的命令,包括:镜像增删改查导入导出、容器增删改查、网络配置。
镜像命令
[root@lch ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
app v1.0 d45bee24a299 About an hour ago 839MB
registry 2 773dbf02e42e 5 days ago 24.1MB
192.168.1.240:5000/hello-world v1.0 feb5d9fea6a5 8 months ago 13.3kB
# 所有镜像,包括中间镜像
[root@lch ~]# docker images -a
# 只显示镜像 ID
[root@lch ~]# docker images -q
# 显示镜像的摘要信息
[root@lch ~]# docker images --digests
# 显示镜像的完整信息
[root@lch ~]# docker images --no-trunc
REPOSITORY TAG IMAGE ID CREATED SIZE
app v1.0 sha256:d45bee24a2994afb9032315c5f006dd6a3ddce304a3306726395ea274e7ba044 About an hour ago 839MB