docker 命令
容器生命周期管理
create Create a new container
run Run a command in a new container
restart Restart one or more containers
rm Remove one or more containers
pause /unpause 暂停/取消暂停一个或多个容器中的所有进程
update Update configuration of one or more containers
kill Kill one or more running containers
exec 在正在运行的容器中运行命令(docker exce -it 容器id /bin/bash)
start /stop/restart
容器操作
attach Attach local standard input, output, and error streams to a running container
events 从docker容器中获取实时事件( docker events -f "image"="mysql:5.6" --since="1467302400" )
ps List containers
top Display the running processes of a container
inspect Return low-level information on Docker objects
logs Fetch the logs of a container
wait Block until one or more containers stop, then print their exit codes
import Import the contents from a tarball to create a filesystem image
export Export a container's filesystem as a tar archive
port List port mappings or a specific mapping for the container (docker port 容器id/name)
容器rootfs命令
rootfs 根文件系统,即docker的镜像。docker 镜像是利用UnionFS + layer 的概念。
commit Create a new image from a container's changes
cp 在容器和本地文件系统之间复制文件/文件夹
diff 检查容器文件系统上文件或目录的更改
镜像仓库
login Log in to a Docker registry
logout Log out from a Docker registry
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
本地镜像管理
build 从Dockerfile构建image (docker build -t tag:version Dockerfile所在目录)
history Show the history of an image
images List images
load Load an image from a tar archive or STDIN
rename Rename a container
rmi Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
search Search the Docker Hub for images
stats 显示容器资源使用情况统计信息的实时流
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
info/version
info Display system-wide information
version Show the Docker version information
docker-compose命令
build Build or rebuild services
config Validate and view the Compose file
create Create services
down Stop and remove containers, networks, images, and volumes
events Receive real time events from containers
exec Execute a command in a running container
help Get help on a command
images List images
kill Kill containers
logs View output from containers
pause Pause services
port Print the public port for a port binding
ps List containers
pull Pull service images
push Push service images
restart Restart services
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker-Compose version information
举个例子
docker-compose -f /usr/local/project/docker-compose.yml restart