标签:ges exec NPU import mes 移除 ica ppi ted
[root@ken1 ~]# docker container --help Usage: docker container COMMAND Manage containers Commands: attach Attach local standard input, output, and error streams to a running container 进入容器,退出时容器会结束 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 查看容器有哪些文件被改变了 exec Run a command in a running container 执行命令或者进入容器 export Export a container‘s filesystem as a tar archive 导出容器的文件至压缩包import inspect Display detailed information on one or more containers 查看容器详细信息 kill Kill one or more running containers 强制杀掉容器 kill -9 logs Fetch the logs of a container 获取容器日志 ls List containers 查看容器 ps 查看运行容器 pause Pause all processes within one or more containers 暂停容器 port List port mappings or a specific mapping for the container 查看容器的端口映射信息 prune Restart all stopped containers 移除不常使用的容器 rename Rename a container 容器改名 restart Restart one or more containers 重启容器 rm Remove one or more containers 删除容器 run Run a command in a new container 运行命令。运行容器 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 优雅退出容器 kill -15 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 更新容器的CPU,内存等信息 wait Block until one or more containers stop, then print their exit codes 等待容器退出,并打印退出状态吗
[root@ken1 ~]# docker run -d --name http(容器名) --rm httpd:load(镜像名:TAG) #注意:容器名字是不能重合的 - name:指定容器名字 - d:表示后台运行 - rm:容器关闭时自动删除容器
[root@ken1 ~]# docker ps #只能查看正在运行的容器 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f25c10ca1bdd httpd "httpd-foreground" 20 seconds ago Up 18 seconds 80/tcp ken 容器标识 镜像 镜像内部执行的指令 启动容器时间 正常运行时间 镜像暴露的端口 容器名
[root@ken1 ~]# docker ps -a #查看正在运行以及退出状态的容器 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d0ec4e0331f7 httpd "httpd-foreground" 16 seconds ago Exited (0) 8 seconds ago ken [root@ken1 ~]# docker ps -aq #只显示容器id d0ec4e0331f7
[root@ken1 ~]# docker stop ken #指定容器名或者容器ID [root@ken1 ~]# docker stop $(docker ps -aq) #批量停掉容器 [root@ken1 ~]# docker rm -f $(docker ps -aq) #批量删除容器
[root@ken1 ~]# docker inspect 05a34c46eddf #指定容器名或者容器ID
[root@ken1 ~]# docker stats 6df99a377bd7 CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 6df99a377bd7 quizzical_yonath 0.01% 13.31MiB / 100MiB 13.31% 648B / 0B 0B / 0B 82
[root@ken1 ~]# docker top 6df99a377bd7
[root@ken1 ~]# docker logs 6df99a377bd7 [root@ken1 ~]# docker logs 6df99a377bd7 -f #持续刷新容器日志
[root@ken1 ~]# docker pause 6df99a377bd7 #暂停容器 6df99a377bd7
[root@ken1 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6df99a377bd7 httpd "httpd-foreground" 16 minutes ago Up 16 minutes (Paused) 80/tcp quizzical_yonath
[root@ken1 ~]# docker unpause 6df99a377bd7
[root@ken1 ~]# docker rename quizzical_yonath ken [root@ken1 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6df99a377bd7 httpd "httpd-foreground" 18 minutes ago Up 18 minutes 80/tcp ken
[root@ken1 ~]# docker port 0192e3d550d27e
[root@ken1 ~]# docker exec -it 0192e3d550d2 /bin/sh 或 /bin/bash
[root@ken1 ~]# docker exec 0192e3d550d2 ls
[root@ken1 ~]# docker cp docker-speed.sh 0192e3d550d2:/usr/local/apache2/htdocs 复制容器内的文件至宿主机 [root@ken1 ~]# docker cp 0192e3d550d2:/usr/local/apache2/htdocs/index.html .
[root@ken1 ~]# docker diff 0192e3d550d2 C /usr C /usr/local C /usr/local/apache2 C /usr/local/apache2/htdocs A /usr/local/apache2/htdocs/docker-speed.sh
标签:ges exec NPU import mes 移除 ica ppi ted
原文地址:https://www.cnblogs.com/twoo/p/11815463.html