(base) root@localhost:/home/cpss# docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest d1165f221234 4 months ago 13.3kB studyfang/hgn latest 37553493935b 10 months ago 8.88GB
docker version # docker的版本信息 docker info # 显示docker的系统信息,包括镜像和容器的数量 docker 命令 --help# 帮助命令
镜像命令
docker images
1 2 3 4
(base) root@localhost:/home/cpss# docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest d1165f221234 4 months ago 13.3kB studyfang/hgn latest 37553493935b 10 months ago 8.88GB
REPOSITORY 镜像的仓库源
TAG 镜像的标签
IMAGE ID 镜像的id
CREATED 镜像的创建时间
SIZE 镜像大小
1 2 3
Options: -a, --all Show all images (default hides intermediate images) -q, --quiet Only show image IDs
docker search 搜索镜像
1 2 3 4 5 6 7 8 9
(base) root@localhost:/home/cpss# docker search hotpotqa NAME DESCRIPTION STARS OFFICIAL AUTOMATED qipeng/hotpotqa-eval 0 studyfang/hotpotqa 0 qipeng/hotpotqa-base 0 tuming1990/hotpotqa-docker 0 hamishivi/hotpotqa-base Hotpotqa with extra packages. 0 qipeng/hotpotqa_submission_cuda10.2 0 tswings2018/hotpotqa by deng 0
(base) root@linux:/home/cpss# docker logs --help Options: --details Show extra details provided to logs -f, --follow Follow log output --since string Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) -n, --tail string Number of lines to show from the end of the logs (default "all") -t, --timestamps Show timestamps --until string Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
# -tf 显示日志 # --tail number 要显示日志条数 docker logs -tf --tail 10 f3c59b35b738 # 容器没有日志 # 自己写一段shell (base) root@linux:/home/cpss# docker run -d centos /bin/sh -c "while true;do echo 111;sleep 1;done" ba0ae87cb0949d44e179f03e2bb3e25a38b394bb98b7aa0f4a1a2b9ad68ca86d (base) root@linux:/home/cpss# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ba0ae87cb094 centos "/bin/sh -c 'while t…" 3 seconds ago Up 1 second determined_bouman (base) root@linux:/home/cpss# docker logs -tf --tail 10 ba0ae87cb094