查看docker的子命令,直接敲docker
或完整的docker help
就可以了:
bash-3.2$ docker Usage: docker [OPTIONS] COMMAND [arg...] A self-sufficient runtime for linux containers. Options: -D, --debug=false Enable debug mode -d, --daemon=false Enable daemon mode -H, --host=[] Daemon socket(s) to connect to -h, --help=false Print usage -l, --log-level=info Set the logging level --tls=false Use TLS; implied by --tlsverify --tlscacert=~/.boot2docker/certs/boot2docker-vm/ca.pem Trust certs signed only by this CA --tlscert=~/.boot2docker/certs/boot2docker-vm/cert.pem Path to TLS certificate file --tlskey=~/.boot2docker/certs/boot2docker-vm/key.pem Path to TLS key file --tlsverify=true Use TLS and verify the remote -v, --version=false Print version information and quit Commands: attach Attach 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 from a container‘s filesystem to the host path create Create a new container diff Inspect changes on a container‘s filesystem events Get real time events from the server exec Run a command in a running container export Stream the contents of a container as a tar archive history Show the history of an image images List images import Create a new filesystem image from the contents of a tarball info Display system-wide information inspect Return low-level information on a container or image kill Kill a running container load Load an image from a tar archive login Register or log in to a Docker registry server logout Log out from a Docker registry server logs Fetch the logs of a container port Lookup the public-facing port that is NAT-ed to PRIVATE_PORT pause Pause all processes within a container ps List containers pull Pull an image or a repository from a Docker registry server push Push an image or a repository to a Docker registry server rename Rename an existing container restart Restart a running container rm Remove one or more containers rmi Remove one or more images run Run a command in a new container save Save an image to a tar archive search Search for an image on the Docker Hub start Start a stopped container stats Display a stream of a containers‘ resource usage statistics stop Stop a running container tag Tag an image into a repository top Lookup the running processes of a container unpause Unpause a paused container version Show the Docker version information wait Block until a container stops, then print its exit code Run ‘docker COMMAND --help‘ for more information on a command.
1、镜像
docker pull NAME[:TAG] #从网络上下载镜像,如果不指定TAG默认下载latest docker pull dl.dockerpool.com:5000/ubuntu #从dockerpool镜像源下载最新的ubuntu镜像 docker images #列出本地主机上已有的镜像 docker inspect <IMAGE ID> #获取该镜像的详细信息 docker inspect -f {{".Author"}} <IMAGE ID> #使用-f参数,获取镜像的Author信息 docker search TEAM #搜索远程仓库中共享的镜像,默认搜索Docker Hub官方仓库中的镜像 docker search --automated=false/--no-trunc=false/-s, --stars=0 #仅显示自动创建的镜像/输出信息不截断显示/指定显示评价为指定星级以上的镜像 docker rmi <IMAGE ID> #删除镜像 docker rmi -f <IMAGE ID> #强制删除镜像 docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]] #提交成为一个新的镜像 -m 提交信息、-a 作者信息、 -p 提交是暂停容器运行 cat ubuntu-14.04-x86_64-minimal.tar.gz | docker import - ubuntu:14.04 #从模板中导入镜像 docker load --input ubuntu_14.04.tar 或 docker load ubuntu_14.04.tar #导入镜像到本地 docker push NAME[TAG] #上传镜像到仓库
未完待续.......
时间: 2024-11-05 13:36:39