admin 管理员组

文章数量: 887017


2024年1月5日发(作者:jsp开发平台)

-D, --debug Enable debug mode-H, --host list Daemon socket(s) to connect to-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")--tls Use TLS; implied by --tlsverify--tlscacert string Trust certs signed only by this CA (default "/root/.docker/")--tlscert string Path to TLS certificate file (default "/root/.docker/")--tlskey string Path to TLS key file (default "/root/.docker/")--tlsverify Use TLS and verify the remote-v, --version Print version information and quit2.3、查看镜像分层[root@ansible-server ~]# docker image history nginx:latestIMAGE CREATED CREATED BY SIZE COMMENT53f3fd8007f7 2 weeks ago /bin/sh -c #(nop) CMD ["nginx" "-g" "daemon… 0B2 weeks ago /bin/sh -c #(nop) STOPSIGNAL SIGTERM 0B2 weeks ago /bin/sh -c #(nop) EXPOSE 80 0B2 weeks ago /bin/sh -c ln -sf /dev/stdout /var/log/nginx… 22B2 weeks ago /bin/sh -c set -x && apt-get update && apt… 54.1MB2 weeks ago /bin/sh -c #(nop) ENV NJS_VERSION=1.15.12.0… 0B2 weeks ago /bin/sh -c #(nop) ENV NGINX_VERSION=1.15.12…0B2 weeks ago /bin/sh -c #(nop) LABEL maintainer=NGINX Do… 0B2 weeks ago /bin/sh -c #(nop) CMD ["bash"] 0B2 weeks ago /bin/sh -c #(nop) ADD file:fcb9328ea4c115670… 55.3MB2.4、查看镜像的详细信息查看镜像的详细信息[root@ansible-server ~]# docker image inspect nginx[{"Id": "sha256:53f3fd8007f76bd23bf663ad5f5009c8941f63828ae458cef584b5f85dc0a7bf","RepoTags": ["nginx:latest"],"RepoDigests": [省略部分......2.5、下载镜像

[root@ansible-server ~]# docker image pull nginx:1.111.11: Pulling from library/nginx6d827a3ef358: Pull completef8f2e0556751: Pull complete5c9972dca3fd: Pull complete451b9524cb06: Pull completeDigest: sha256:e6693c20186f837fc393390135d8a598a96a833917917789d63766cab6c59582Status: Downloaded newer image for nginx:1.112.6、删除镜像查看并删除镜像[root@ansible-server ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEnginx latest 53f3fd8007f7 2 weeks ago 109MBnginx 1.11 5766334bdaa0 2 years ago 183MB[root@ansible-server ~]# docker image rm nginx:1.11Untagged: nginx:1.11Untagged: nginx@sha256:e6693c20186f837fc393390135d8a598a96a833917917789d63766cab6c59582Deleted: sha256:5766334bdaa0bc37f1f0c02cb94c351f9b076bcffa042d6ce811b0fd9bc31f3bDeleted: sha256:1fcf2d3addf02c3b6add24c7b0993038f7e3eee616b10e671e25440e03bc7697Deleted: sha256:51c56cdbb9306c4d6f2da2b780924f3b926bd13d15a4f6693a5175690e288436Deleted: sha256:ec9a826666cfa5df0471f716145da63294019c09a5f2e31613122b57df8f7ce0Deleted: sha256:5d6cbe0dbcf9a675e86aa0fbedf7ed8756d557c7468d6a7c64bde7fa9e0296362.7、给镜像打tag#给镜像打tag,再查看[root@ansible-server ~]# docker tag nginx:1.11 nginx:v1[root@ansible-server ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEnginx latest 53f3fd8007f7 2 weeks ago 109MBnginx 1.11 5766334bdaa0 2 years ago 183MBnginx v1 5766334bdaa0 2 years ago 183MB2.8、导出镜像[root@ansible-server ~]# docker image save nginx:1.11 >[root@ansible-server ~]# du -sh

nginx latest 53f3fd8007f7 2 weeks ago 109MBnginx 1.11 5766334bdaa0 2 years ago 183MBnginx v1 5766334bdaa0 2 years ago 183MB三、容器管理3.1、查看容器命令[root@ansible-server ~]# docker container --helpUsage: docker container COMMANDManage containersCommands:attach Attach local standard input, output, and error streams to a running containercommit Create a new image from a container's changescp Copy files/folders between a container and the local filesystemcreate Create a new containerdiff Inspect changes to files or directories on a container's filesystemexec Run a command in a running containerexport Export a container's filesystem as a tar archiveinspect Display detailed information on one or more containerskill Kill one or more running containerslogs Fetch the logs of a containerls List containerspause Pause all processes within one or more containersport List port mappings or a specific mapping for the containerprune Remove all stopped containersrename Rename a containerrestart Restart one or more containersrm Remove one or more containersrun Run a command in a new containerstart Start one or more stopped containersstats Display a live stream of container(s) resource usage statisticsstop Stop one or more running containerstop Display the running processes of a containerunpause Unpause all processes within one or more containersupdate Update configuration of one or more containerswait Block until one or more containers stop, then print their exit codes


本文标签: 镜像 查看 详细信息 开发 平台