docker基础:管理命令
Posted rohn
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker基础:管理命令相关的知识,希望对你有一定的参考价值。
管理命令
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
以上是关于docker基础:管理命令的主要内容,如果未能解决你的问题,请参考以下文章