docker基础:管理命令

编程

容器是一种清理级、可移植、自包含的软件打包技术,使应用程序可以在几乎任何地方以相同的方式运行。

blog:https://www.cnblogs.com/Rohn/

目录

  • 管理命令
    • 管理网络
    • 管理容器
    • 管理服务
    • 管理节点
    • 管理插件

管理命令

  • docker network:管理网络;
  • docker container:管理容器;
  • docker service:管理服务;
  • docker node:管理Swarm节点;
  • docker plugin:管理插件;
  • docker stack:管理堆栈;
  • docker system:管理系统信息;
  • docker swarm:管理Swarm集群;
  • docker volume:管理卷;

管理网络

语法如下:

docker network COMMAND

Commands:

connect Connect a container to a network

create Create a network

disconnect Disconnect a container from a network

inspect Display detailed information on one or more networks

ls List networks

prune Remove all unused networks

rm Remove one or more networks

管理容器

语法如下:

docker container COMMAND

Commands:

attach Attach 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

inspect Display detailed information on one or more containers

kill Kill one or more running containers

logs Fetch the logs of a container

ls List containers

pause Pause all processes within one or more containers

port List port mappings or a specific mapping for the container

prune Remove 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

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

wait Block until one or more containers stop, then print their exit codes

管理服务

语法如下:

docker service COMMAND

Commands:

create Create a new service

inspect Display detailed information on one or more services

ls List services

ps List the tasks of a service

rm Remove one or more services

scale Scale one or multiple replicated services

update Update a service

管理节点

语法如下:

docker node COMMAND

Commands:

demote Demote one or more nodes from manager in the swarm

inspect Display detailed information on one or more nodes

ls List nodes in the swarm

promote Promote one or more nodes to manager in the swarm

ps List tasks running on one or more nodes, defaults to current node

rm Remove one or more nodes from the swarm

update Update a node

管理插件

语法如下:

docker plugin COMMAND

Commands:

create Create a plugin from a rootfs and configuration. Plugin data directory must contain config.json and rootfs directory.

disable Disable a plugin

enable Enable a plugin

inspect Display detailed information on one or more plugins

install Install a plugin

ls List plugins

push Push a plugin to a registry

rm Remove one or more plugins

set Change settings for a plugin

upgrade Upgrade an existing plugin

原文链接:https://www.cnblogs.com/Rohn/archive/2020/07/13/13291401.html

以上是 docker基础:管理命令 的全部内容, 来源链接: utcz.com/z/518297.html

回到顶部