话不多说,上Hello World
$ sudo docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
查看拉取的Image
$ sudo docker image ls
[sudo] password for king:
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 9 months ago 13.3kB
查看运行过的所有容器
$ sudo docker ps --all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a6d06bdacfb7 hello-world "/hello" 3 days ago Exited (0) 3 days ago beautiful_shockley
a07b1c26eba8 hello-world "/hello" 3 days ago Exited (0) 3 days ago eloquent_shirley
101da06ce0c1 hello-world "/hello" 5 days ago Exited (0) 5 days ago determined_torvalds
3db0e6cfc853 hello-world "/hello" 5 days ago Exited (0) 5 days ago charming_ardinghelli
入门docker成功