02Docker命令

目录

开机启动docker systemctl enable docker

yum命令 

(1) yum清空缓存列表

(2)  yum显示信息

(3)  yum安装

(4)  yum删除

(5 ) yum包的升级

帮助命令 --help

镜像命令

命令1:查看所有的镜像   docker images

        docker images -aq 

命令2:搜索镜像   docker search

命令3:下载镜像        docker pull

命令4:删除镜像   docker rmi

         docker rmi -f $(docker images -aq) # 删除全部的容器

命令5:docker system df  查看镜像/容器/数据卷所占的空间

命令6:修改镜像名字 docker tag

面试题:docker 虚悬镜像是什么?

容器命令

新建容器并启动   docker run image

查看当前正在运行过的容器 docker ps

退出容器  exit ctrl + p+ q

删除容器  docker rm

启动和停止容器的操作

容器内添加命令

常用其他命令 重要

后台启动容器 docker run -d 镜像名

查看日志 docker logs

查看容器中进程信息ps  docker top

查看镜像的元数据 重要   docker inspect

进入当前正在进行的容器 重要  docker exec -it 交互模式执行

从容器中拷贝文件到主机  docker cp

小结


开机启动docker systemctl enable docker

yum命令 

(1) yum清空缓存列表

yum clean packages 清除缓存目录下的软件包,清空的是(/var/cache/yum)下的缓存
yum clean headers 清除缓存目录下的 headers
yum clean oldheaders 清除缓存目录下旧的 headers
yum clean, yum clean all (= yum clean packages; yum clean oldheaders) 清除缓存目录下的软件包及旧的headers

(2)  yum显示信息

yum list          # yum list显示所有已经安装和可以安装的程序包

(3)  yum安装

yum -y install httpd

安装完之后查询一下

yum list httpd,Installed 说明已经安装好了

(4)  yum删除

yum remove httpd 删除程序包httpd ,也就是卸载。

yum deplist rpm 查看程序rpm依赖情况

(5 ) yum包的升级

yum check-update 检查可更新的程序

        yum update 全部更新,升级所有包,以及升级软件和系统内核,这就是一键升级。他可以更新CentOS的内核到最新版本

帮助命令 --help

        命令:docker 命令 --help

        docker version #显示docker的版本信息
        docker info    #显示docker的系统信息,包括镜像和容器的数量
        docker 命令 --help #万能命令

帮助文档的地址:Reference documentation | Docker Documentation

镜像命令

命令1:查看所有的镜像   docker images

docker images
docker images -a 展示所有镜像
docker images -q 只展示镜像的ID

        docker images -aq 

[root@gh ~]# systemctl start docker                    # 启动docker
[root@gh ~]# docker images --help                      # docker images -help 的帮助文档  

Usage:  docker images [OPTIONS] [REPOSITORY[:TAG]]

List images

Options:
  -a, --all             Show all images (default hides intermediate images)
      --digests         Show digests
  -f, --filter filter   Filter output based on conditions provided
      --format string   Pretty-print images using a Go template
      --no-trunc        Don't truncate output
  -q, --quiet           Only show image IDs
[root@gh ~]# docker images                        # 查看全部的镜像
REPOSITORY    TAG       IMAGE ID       CREATED        SIZE
hello-world   latest    feb5d9fea6a5   5 months ago   13.3kB

#解释
REPOSITORY	镜像的仓库源
TAG			镜像的标签 
IMAGE ID	镜像的id
CREATED     镜像的创建时间 
SIZE		镜像的大小

#可选项
-a, --all      #列出所有镜像 
-q, --quiet    #只显示镜像的

[root@gh ~]# docker images -a
REPOSITORY    TAG       IMAGE ID       CREATED        SIZE
hello-world   latest    feb5d9fea6a5   5 months ago   13.3kB
[root@gh ~]# docker images -q
feb5d9fea6a5
[root@gh ~]# docker images -aq    常用显示全部镜像id
feb5d9fea6a5

命令2:搜索镜像   docker search

docker search 镜像
docker search 镜像 --filter=starts=3000  

[root@gh ~]# docker search mysql
NAME                             DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
mysql                            MySQL is a widely used, open-source relation…   12252     [OK]       
mariadb                          MariaDB Server is a high performing open sou…   4709      [OK]       
mysql/mysql-server               Optimized MySQL Server Docker images. Create…   908                  [OK]
percona                          Percona Server is a fork of the MySQL relati…   572       [OK]       
phpmyadmin                       phpMyAdmin - A web interface for MySQL and M…   470       [OK] 
......... 

#可选项,通过搜索来过滤
--filter=STARS=3000 
	docker search mysql --filter=STARS=3000  搜索出来的镜像就是STRAS大于3000
	
[root@gh ~]# docker search mysql --filter=STARS=4500
NAME      DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
mysql     MySQL is a widely used, open-source relation…   12252     [OK]       
mariadb   MariaDB Server is a high performing open sou…   4709      [OK] 

命令3:下载镜像        docker pull

docker pull 镜像 :默认下载最新版本(latest)
docker pull 镜像:版本 :下载指定的版本

[root@gh ~]# docker pull mysql
Using default tag: latest      		#如果默认tag 默认就是latest
latest: Pulling from library/mysql
a10c77af2613: Pull complete 	    #分层下载 docker image的核心 联合文件系统
b76a7eb51ffd: Pull complete 
258223f927e4: Pull complete 
2d2c75386df9: Pull complete 
63e92e4046c9: Pull complete 
f5845c731544: Pull complete 
bd0401123a9b: Pull complete 
3ef07ec35f1a: Pull complete 
c93a31315089: Pull complete 
3349ed800d44: Pull complete 
6d01857ca4c1: Pull complete 
4cc13890eda8: Pull complete 
Digest: sha256:aeecae58035f3868bf4f00e5fc623630d8b438db9d05f4d8c6538deb14d4c31b #签名
Status: Downloaded newer image for mysql:latest
docker.io/library/mysql:latest  #真是地址

#等价于它
docker pull mysql
docker pull docker.io/library/mysql:latest

#指定版本下载
[root@gh ~]# docker pull mysql:5.7
5.7: Pulling from library/mysql
a10c77af2613: Already exists 
b76a7eb51ffd: Already exists 
258223f927e4: Already exists 
2d2c75386df9: Already exists 
63e92e4046c9: Already exists 
f5845c731544: Already exists 
bd0401123a9b: Already exists 
2724b2da64fd: Pull complete 
d10a7e9e325c: Pull complete 
1c5fd9c3683d: Pull complete 
2e35f83a12e9: Pull complete 
Digest: sha256:7a3a7b7a29e6fbff433c339fc52245435fa2c308586481f2f92ab1df239d6a29
Status: Downloaded newer image for mysql:5.7
docker.io/library/mysql:5.7

命令4:删除镜像   docker rmi

删除指定的镜像

docker rmi -f 镜像ID:删除镜像

         docker rmi -f $(docker images -aq) # 删除全部的容器

[root@gh ~]# docker rmi -f feb5d9fea6a5[容器id]  #删除指定的容器   
    -f 删除指定容器【镜像id】
	-f 删除多个容器【镜像id】【镜像id】【镜像id】【镜像id】【镜像id】
	-f $(docker images -aq)	 【复合删除】(docker images -aq 查出所有的镜像)  之后进行删除  删除全部的容器

[root@gh ~]# docker rmi -f $(docker images -aq) # 删除全部的容器

命令5:docker system df  查看镜像/容器/数据卷所占的空间

[root@gh ~]# docker system df
#类型           总数       活跃的    大小       可伸缩性
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          9         1         4.242GB   3.562GB (83%)
Containers      1         0         5.635kB   5.635kB (100%)
Local Volumes   0         0         0B        0B
Build Cache     0         0         0B        0B

命令6:修改镜像名字 docker tag

[root@gh ~]# docker tag mytomcat:1.1 xxx.xxx.xxx.xxx[服务器端口]:8081/mytomcat:1.2
[root@gh ~]# docker images
REPOSITORY                     TAG       IMAGE ID       CREATED        SIZE
mytomcat                       1.1       c62069e2ed0b   17 hours ago   746MB
101.201.234.58:8081/mytomcat   1.2       c62069e2ed0b   17 hours ago   746MB

面试题:docker 虚悬镜像是什么?

仓库名、标签都是<none>的镜像,俗称虚悬镜像dangling image

容器命令

值得注意的是,我们有了镜像才可以创建容器。

新建容器并启动   docker run image

docker run [可选参数] image

#参数说明

--name 容器名称 区分容器
-d     后台方式运行
-it    使用交互方式进行,进入容器查看内容
	交互运行  需要给一个控制台 一般在/bin下 默认使用/bin/bash
-P(大写)  指定容器端口
   -P 主机端口:容器端口 (常用)
   -P 容器端口
   容器端口 
   -P ip主机端口	
-p(小写)  随机指定端口

#测试,启动并进入容器
[root@gh ~]#  docker run -it centos /bin/bash
[root@794b213af7a2 /]#       # 794b213af7a2  容器id
#查看容器内的 centos
[root@gh ~]# ls  基础版本,很多命令都是不完善的!
bin  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
#从容器中退回主机
[root@gh ~]# exit
exit

查看当前正在运行过的容器 docker ps

 #查看当前正在运行的容器
 doceker ps 命令   #查看当前正在运行过的容器
      -a     #查看当前正在运行过的容器 + 带历史运行的容器
      -n=?  #显示最近创建的容器
      -q     #只显示容器的编号
[root@gh ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@gh ~]# docker ps -n =1 # 显示最近创建的一个容器

退出容器  exit ctrl + p+ q

 exit #容器停止退出
 ctrl + p + q # 容器不停止退出

删除容器  docker rm

 docker rm 容器id        #删除指定容器,不能删除正在运行的容器,如果要强制删除 rm -f
 docker rm -f $(docker ps -aq) #删除所有容器
 docker ps -a -q |xargs docker rm #删除所有容器

启动和停止容器的操作

 docker start 容器id     #启动容器
 docker restart 容器id   #重启容器
 docker stop 容器id    #停止当前正在运行容器
 docker kill 容器id    #强制停止容器

容器内添加命令

# 1、进入容器
[root@gh ~]# docker exec -it tomcat01 /bin/bash
# 2、执行 apt-get update  先更新我们的包管理工具
root@d6ed68dc1714:/usr/local/tomcat# apt-get update
# 3、安装我们所需要的 ip 指令
root@d6ed68dc1714:/usr/local/tomcat# apt install -y iproute2
# 4、安装我们所需要的 ping 指令
root@d6ed68dc1714:/usr/local/tomcat# apt install iputils-ping

常用其他命令 重要

后台启动容器 docker run -d 镜像名

 # 命令 docker run -d 镜像名
[root@gh ~]# docker run -d centos
  
 # 问题 docker ps, 发现centos停止了
  
 # 常见的坑, docker 容器使用后台运行, 就必须要有一个前台进程,docker发现没有应用,就会自动停止
 # nginx, 容器启动后,发现自己没有提供服务,就会立即停止,就是没有程序了

查看日志 docker logs

 docker logs -tf --tail number 容器id
    --since : 此参数指定了输出日志开始日期,即只输出指定日期之后的日志。 
    -f : 查看实时日志
    -t : 查看日志产生的日期 
    -tail=10 : 查看最后的10条日志


-t : 查看日志产生
的日期 -tail=10 : 查看最后的10条日志 qfjy_exam : 容器名称
  
[root@gh ~]#]# docker logs -tf --tail 1 8d1621e09bff    # 日志输出
 2022-03-16T10:53:15.987702897Z [root@gh ~]# exit      
  
 # 自己编写一段shell脚本
   -d 后台启动 让centos 有作用             -c写命令  循环 打印xiaofang 每隔一秒打印一次
[root@gh ~]#docker run -d centos /bin/sh -c "while true;do echo xiaofan;sleep 1;done"
 a0d580a21251da97bc050763cf2d5692a455c228fa2a711c3609872008e654c2
  
[root@gh ~]# docker ps
 CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
 a0d580a21251        centos              "/bin/sh -c 'while t…"   3 seconds ago       Up 1 second                             lucid_black
  
 # 显示日志
 -tf                 # 显示日志
 --tail number       # 显示日志条数 
[root@gh ~]# docker logs -tf --tail 10 a0d580a21251 # 显示10条日志信息

查看容器中进程信息ps  docker top

 # 命令 docker top 容器id
[root@gh ~]# docker top df358bc06b17
 UID                 PID                 PPID           C     STIME               TTY   
 root                28498               28482          0       19:38               ?   

查看镜像的元数据 重要   docker inspect

 # 命令
 docker inspect 容器id
  
 #测试 
 [root@gh ~]# docker inspect 794b213af7a2 
 [
     {
         "Id": "794b213af7a21f664814619e58da3424e70a232a33026c495ab149c8bddf96b3",
         "Created": "2022-3-16T10:38:46.25261698Z",
         "Path": "/bin/bash",
         "Args": [],
         "State": {
             "Status": "running",
             "Running": true,
             "Paused": false,
             "Restarting": false,
             "OOMKilled": false,
             "Dead": false,
             "Pid": 9919,
             "ExitCode": 0,
             "Error": "",
             "StartedAt": "2021-11-28T10:52:20.339303889Z",
             "FinishedAt": "2021-11-28T10:41:11.605667875Z"
         },
         "Image": "sha256:5d0da3dc976460b72c77d94c8a1ad043720b0416bfc16c52c45d4847e53fadb6",
         "ResolvConfPath": "/var/lib/docker/containers/794b213af7a21f664814619e58da3424e70a232a33026c495ab149c8bddf96b3/resolv.conf",
         "HostnamePath": "/var/lib/docker/containers/794b213af7a21f664814619e58da3424e70a232a33026c495ab149c8bddf96b3/hostname",
         "HostsPath": "/var/lib/docker/containers/794b213af7a21f664814619e58da3424e70a232a33026c495ab149c8bddf96b3/hosts",
         "LogPath": "/var/lib/docker/containers/794b213af7a21f664814619e58da3424e70a232a33026c495ab149c8bddf96b3/794b213af7a21f664814619e58da3424e70a232a33026c495ab149c8bddf96b3-json.log",
         "Name": "/agitated_solomon",
         "RestartCount": 0,
         "Driver": "overlay2",
         "Platform": "linux",
         "MountLabel": "",
         "ProcessLabel": "",
         "AppArmorProfile": "",
         "ExecIDs": null,
         "HostConfig": {
             "Binds": null,
             "ContainerIDFile": "",
             "LogConfig": {
                 "Type": "json-file",
                 "Config": {}
             },
             "NetworkMode": "default",
             "PortBindings": {},
             "RestartPolicy": {
                 "Name": "no",
                 "MaximumRetryCount": 0
             },
             "AutoRemove": false,
             "VolumeDriver": "",
             "VolumesFrom": null,
             "CapAdd": null,
             "CapDrop": null,
             "CgroupnsMode": "host",
             "Dns": [],
             "DnsOptions": [],
             "DnsSearch": [],
             "ExtraHosts": null,
             "GroupAdd": null,
             "IpcMode": "private",
             "Cgroup": "",
             "Links": null,
             "OomScoreAdj": 0,
             "PidMode": "",
             "Privileged": false,
             "PublishAllPorts": false,
             "ReadonlyRootfs": false,
             "SecurityOpt": null,
             "UTSMode": "",
             "UsernsMode": "",
             "ShmSize": 67108864,
             "Runtime": "runc",
             "ConsoleSize": [
                 0,
                 0
             ],
             "Isolation": "",
             "CpuShares": 0,
             "Memory": 0,
             "NanoCpus": 0,
             "CgroupParent": "",
             "BlkioWeight": 0,
             "BlkioWeightDevice": [],
             "BlkioDeviceReadBps": null,
             "BlkioDeviceWriteBps": null,
             "BlkioDeviceReadIOps": null,
             "BlkioDeviceWriteIOps": null,
             "CpuPeriod": 0,
             "CpuQuota": 0,
             "CpuRealtimePeriod": 0,
             "CpuRealtimeRuntime": 0,
             "CpusetCpus": "",
             "CpusetMems": "",
             "Devices": [],
             "DeviceCgroupRules": null,
             "DeviceRequests": null,
             "KernelMemory": 0,
             "KernelMemoryTCP": 0,
             "MemoryReservation": 0,
             "MemorySwap": 0,
             "MemorySwappiness": null,
             "OomKillDisable": false,
             "PidsLimit": null,
             "Ulimits": null,
             "CpuCount": 0,
             "CpuPercent": 0,
             "IOMaximumIOps": 0,
             "IOMaximumBandwidth": 0,
             "MaskedPaths": [
                 "/proc/asound",
                 "/proc/acpi",
                 "/proc/kcore",
                 "/proc/keys",
                 "/proc/latency_stats",
                 "/proc/timer_list",
                 "/proc/timer_stats",
                 "/proc/sched_debug",
                 "/proc/scsi",
                 "/sys/firmware"
             ],
             "ReadonlyPaths": [
                 "/proc/bus",
                 "/proc/fs",
                 "/proc/irq",
                 "/proc/sys",
                 "/proc/sysrq-trigger"
             ]
         },
         "GraphDriver": {
             "Data": {
                 "LowerDir": "/var/lib/docker/overlay2/71b206fb5217d22f5f9f65a78e4a129c838700546553a89d2f9bb967b55630c3-init/diff:/var/lib/docker/overlay2/0e36021a8a27580154906b211ae9cbb309db5fe65cdad78f9fbb0fadd6c2acdd/diff",
                 "MergedDir": "/var/lib/docker/overlay2/71b206fb5217d22f5f9f65a78e4a129c838700546553a89d2f9bb967b55630c3/merged",
                 "UpperDir": "/var/lib/docker/overlay2/71b206fb5217d22f5f9f65a78e4a129c838700546553a89d2f9bb967b55630c3/diff",
                 "WorkDir": "/var/lib/docker/overlay2/71b206fb5217d22f5f9f65a78e4a129c838700546553a89d2f9bb967b55630c3/work"
             },
             "Name": "overlay2"
         },
         "Mounts": [],
         "Config": {
             "Hostname": "794b213af7a2",
             "Domainname": "",
             "User": "",
             "AttachStdin": true,
             "AttachStdout": true,
             "AttachStderr": true,
             "Tty": true,
             "OpenStdin": true,
             "StdinOnce": true,
             "Env": [
                 "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
             ],
             "Cmd": [
                 "/bin/bash"
             ],
             "Image": "centos",
             "Volumes": null,
             "WorkingDir": "",
             "Entrypoint": null,
             "OnBuild": null,
             "Labels": {
                 "org.label-schema.build-date": "20210915",
                 "org.label-schema.license": "GPLv2",
                 "org.label-schema.name": "CentOS Base Image",
                 "org.label-schema.schema-version": "1.0",
                 "org.label-schema.vendor": "CentOS"
             }
         },
         "NetworkSettings": {
             "Bridge": "",
             "SandboxID": "f180f57d5c6e7e72e7ea15cd2b5cf2cf2a00b8a5c2f9338b02162bbdc7c79bad",
             "HairpinMode": false,
             "LinkLocalIPv6Address": "",
             "LinkLocalIPv6PrefixLen": 0,
             "Ports": {},
             "SandboxKey": "/var/run/docker/netns/f180f57d5c6e",
             "SecondaryIPAddresses": null,
             "SecondaryIPv6Addresses": null,
             "EndpointID": "73384b37bcf80b385a1ff3d0ae8b58cc46ba3d68650edd0aca6672a17b634695",
             "Gateway": "172.17.0.1",
             "GlobalIPv6Address": "",
             "GlobalIPv6PrefixLen": 0,
             "IPAddress": "172.17.0.2",
             "IPPrefixLen": 16,
             "IPv6Gateway": "",
             "MacAddress": "02:42:ac:11:00:02",
             "Networks": {
                 "bridge": {
                     "IPAMConfig": null,
                     "Links": null,
                     "Aliases": null,
                     "NetworkID": "88ed37749ffac8672909d29ed312cb90bd87e463248b6076343392eda1a81f8b",
                     "EndpointID": "73384b37bcf80b385a1ff3d0ae8b58cc46ba3d68650edd0aca6672a17b634695",
                     "Gateway": "172.17.0.1",
                     "IPAddress": "172.17.0.2",
                     "IPPrefixLen": 16,
                     "IPv6Gateway": "",
                     "GlobalIPv6Address": "",
                     "GlobalIPv6PrefixLen": 0,
                     "MacAddress": "02:42:ac:11:00:02",
                     "DriverOpts": null
                 }
             }
         }
     }
 ]
[root@gh ~]# 

进入当前正在进行的容器 重要  docker exec -it 交互模式执行

 # 我们通常容器使用后台方式运行的, 需要进入容器,修改一些配置
  
 # 命令
 docker exec -it 容器id /bin/bash
  
 # 测试
 [root@gh ~]# docker exec -it df358bc06b17 /bin/bash
 [root@gh ~]#ls       
 bin  etc   lib    lost+found  mnt  proc  run   srv  tmp  var
 dev  home  lib64  media       opt  root  sbin  sys  usr
 [root@gh ~]#ps -ef
 UID        PID  PPID  C STIME TTY          TIME CMD
 root         1     0  0 Aug11 pts/0    00:00:00 /bin/bash
 root        29     0  0 01:06 pts/1    00:00:00 /bin/bash
 root        43    29  0 01:06 pts/1    00:00:00 ps -ef
  
 # 方式二
 docker attach 容器id
 ​
 #测试
 [root@gh ~]#docker  attach  df358bc06b17
 正在执行的当前的代码
 ​
 # docker exec       # 进入容器后开启一个新的终端,可以在里面操作(常用)
 # docker attach     # 进入容器正在执行的终端,不会启动新的进程

从容器中拷贝文件到主机  docker cp

docker cp 容器id:容器内路径    目的地主机路径
 ​
 ​
 [root@gh ~]#docker ps
 CONTAINER ID     IMAGE    COMMAND     CREATED         STATUS       PORTS      NAMES
 56a5583b25b4     centos   "/bin/bash" 7seconds ago    Up 6 seconds      
 ​
 #1. 进入docker容器内部
 [root@iz2zeak7sgj6i7hrb2g862z ~]# docker exec -it 56a5583b25b4 /bin/bash
 [root@gh ~]#ls
 bin  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
 ​
 #在容器内新建一个文件
 [root@55321bcae33d /]# echo "hello" > java.java
 [root@55321bcae33d /]# cat hello.java 
 hello
 [root@55321bcae33d /]# exit
 exit
 ​
 #将这个文件拷贝到主机上 hello.java拷贝到home文件加下
 [root@iz2zeak7sgj6i7hrb2g862z /]# docker cp 56a5583b25b4:/hello.java /home 
 [root@iz2zeak7sgj6i7hrb2g862z /]# cd /home
 [root@iz2zeak7sgj6i7hrb2g862z home]# ls -l    #可以看见java.java存在
 ​
 ​
 #拷贝是一个手动的过程 未来我们使用 -v卷技术,可以实现, 

小结

attach      Attach local standard input, output, and error streams to a running container
   #当前shell下 attach连接指定运行的镜像
   build       Build an image from a Dockerfile # 通过Dockerfile定制镜像
   commit      Create a new image from a container's changes #提交当前容器为新的镜像
   cp          Copy files/folders between a container and the local filesystem #拷贝文件
   create      Create a new container #创建一个新的容器
   diff        Inspect changes to files or directories on a container's filesystem #查看docker容器的变化
   events      Get real time events from the server # 从服务获取容器实时时间
   exec        Run a command in a running container # 在运行中的容器上运行命令
   export      Export a container's filesystem as a tar archive #导出容器文件系统作为一个tar归档文件[对应import]
   history     Show the history of an image # 展示一个镜像形成历史
   images      List images #列出系统当前的镜像
   import      Import the contents from a tarball to create a filesystem image #从tar包中导入内容创建一个文件系统镜像
   info        Display system-wide information # 显示全系统信息
   inspect     Return low-level information on Docker objects #查看容器详细信息
   kill        Kill one or more running containers # kill指定docker容器
   load        Load an image from a tar archive or STDIN #从一个tar包或标准输入中加载一个镜像[对应save]
   login       Log in to a Docker registry #
   logout      Log out from a Docker registry
   logs        Fetch the logs of a container
   pause       Pause all processes within one or more containers
   port        List port mappings or a specific mapping for the container
   ps          List containers
   pull        Pull an image or a repository from a registry
   push        Push an image or a repository to a registry
   rename      Rename a container
   restart     Restart one or more containers
   rm          Remove one or more containers
   rmi         Remove one or more images
   run         Run a command in a new container
   save        Save one or more images to a tar archive (streamed to STDOUT by default)
   search      Search the Docker Hub for images
   start       Start one or more stopped containers
   stats       Display a live stream of container(s) resource usage statistics
   stop        Stop one or more running containers
   tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
   top         Display the running processes of a container
   unpause     Unpause all processes within one or more containers
   update      Update configuration of one or more containers
   version     Show the Docker version information
   wait        Block until one or more containers stop, then print their exit codes
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

gh-xiaohe

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值