安裝docker后葫督,可以使用命令行:
docker help
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options:
--config string Location of client config files (default
"C:\\Users\\Administrator\\.docker")
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level
("debug"|"info"|"warn"|"error"|"fatal")
(default "info")
--tls Use TLS; implied by --tlsverify
--tlscacert string Trust certs signed only by this CA (default
"C:\\Users\\Administrator\\.docker\\ca.pem")
--tlscert string Path to TLS certificate file (default
"C:\\Users\\Administrator\\.docker\\cert.pem")
--tlskey string Path to TLS key file (default
"C:\\Users\\Administrator\\.docker\\key.pem")
--tlsverify Use TLS and verify the remote
-v, --version Print version information and quit
Management Commands:
builder Manage builds
config Manage Docker configs
container Manage containers
image Manage images
network Manage networks
node Manage Swarm nodes
plugin Manage plugins
secret Manage Docker secrets
service Manage services
stack Manage Docker stacks
swarm Manage Swarm
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes
Commands:
attach Attach local standard input, output, and error streams to a running container
build Build an image from a 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
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
history Show the history of an image
images List images
import Import the contents from a tarball to create a filesystem image
info Display system-wide information
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
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
基本命令
倉庫相關(guān)操作
docker pull #從遠(yuǎn)程倉庫拉取鏡像到本地
docker push #推送本地鏡像到遠(yuǎn)程倉庫
docker search #在倉庫搜索鏡像
docker login #登錄到官方倉庫Docker Hub
docker logout #退出登錄
鏡像相關(guān)操作
docker build #從Dockerfile構(gòu)建鏡像
docker pull #同上
docker push #同上
docker history #顯示鏡像的歷史信息
docker images #列出鏡像
docker rmi #刪除鏡像
docker tag #給鏡像打上tag標(biāo)簽
docker run #創(chuàng)建容器并啟動(dòng)容器
docker create #創(chuàng)建容器
docker commit #將修改后的容器生成鏡像
docker load #從壓縮包中加載鏡像
docker import #從歸檔文件中創(chuàng)建鏡像
docker save #將鏡像保存到壓縮文件
容器相關(guān)操作
docker attach #依附到一個(gè)正在運(yùn)行的容器中
docker exec #進(jìn)到正在運(yùn)行的容器中執(zhí)行命令
docker cp #在容器和本地系統(tǒng)間復(fù)制文件
docker update #將一個(gè)容器內(nèi)所有的進(jìn)程從暫停狀態(tài)中恢復(fù)
docker ps #列出主機(jī)中的容器
docker port #查找一個(gè)nat到私有網(wǎng)口的公共口
docker top #查看一個(gè)容器中正在運(yùn)行的進(jìn)程信息
docker logs #查看日志文件
docker diff #檢查容器內(nèi)文件系統(tǒng)的修改
docker status #輸出容器的資源使用統(tǒng)計(jì)信息
docker wait #阻塞直到容器終止
docker start #啟動(dòng)已創(chuàng)建的容器
docker pause #暫停運(yùn)行中的容器
docker unpause #使暫停的容器恢復(fù)運(yùn)行
docker stop #停止容器運(yùn)行
docker rename #容器改名
docker restart #容器重啟
docker kill #關(guān)閉運(yùn)行中的容器
docker rm #刪除容器
docker export #導(dǎo)出容器內(nèi)容為tar包
docker run #同上
docker create #同上
docker commit #同上
其他基本命令
docker events #從服務(wù)端獲取實(shí)時(shí)的事件
docker info #查看系統(tǒng)相關(guān)信息
docker inspect #顯示Docker對(duì)象的具體配置信息竭鞍,包括容器,鏡像橄镜,網(wǎng)絡(luò)等
docker version #輸出Docker的版本信息
管理命令
docker container #容器管理
docker image #鏡像管理
docker network #網(wǎng)絡(luò)管理
docker node #節(jié)點(diǎn)管理
docker plugin #插件管理
docker secret #管理敏感數(shù)據(jù)及普通服務(wù)配置項(xiàng)
docker service #服務(wù)管理
docker stack #棧管理
docker swarm #集群管理
docker system #管理系統(tǒng)信息
docker volume #卷管理