☁ ~ docker --help
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Common Commands:
run Create and run a new container from an image
exec Execute a commandin a running container
ps List containers
build Build an image from a Dockerfile
pull Download an image from a registry
push Upload an image to a registry
images List images
login Log in to a registry
logout Log out from a registry
search Search Docker Hub for images
version Show the Docker version information
info Display system-wide information
子命令帮助
☁ ~ docker run --help
Usage: docker run [OPTIONS] IMAGE [COMMAND][ARG...]
Create and run a new container from an image
Aliases:
docker container run, docker run
Options:
--add-host list Add a custom host-to-IP mapping (host:ip)
--annotation map Add an annotation to the container (passed through to the OCI runtime)(default map[])
-a, --attach list Attach to STDIN, STDOUT or STDERR
--blkio-weight uint16 Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
--blkio-weight-device list Block IO weight (relative device weight)(default [])
--cap-add list Add Linux capabilities
--cap-drop list Drop Linux capabilities
--cgroup-parent string Optional parent cgroup for the container
--cgroupns string Cgroup namespace to use (host|private)......
☁ ~ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
956d0e3e5f3e nginx "/docker-entrypoint.…"2 seconds ago Up 1 second 0.0.0.0:8888->80/tcp, :::8888->80/tcp nginx
此时在浏览器或者终端curl访问:
http://宿主机IP:8888 即可看到111的返回内容