英文出自:http://docs.docker.com/linux/step_one/
1、确定安装了wget
$which wget
如果没有安装它,更新ubuntu的软件管理,然后安装它
$ sudo apt-get update
$ sudo apt-get install wget
2、获得最新的Docker安装包
$ wget -qO- https://get.docker.com/ | sh
系统会提示你关于你的sudo密码。然后它会下载及安装Docker和它的依赖包。
3、验证docker是否安装正确
$ sudo docker run hello-world
Unable to find p_w_picpath ‘hello-world:latest’ locally
Pulling repository docker.io/library/hello-world
975b84d108f1: Download complete
3f12c794407e: Download complete
Status: Downloaded newer p_w_picpath for hello-world:latest
docker.io/library/hello-world: this p_w_picpath was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker.
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” p_w_picpath from the Docker Hub.
3. The Docker daemon created a new container from that p_w_picpath 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 p_w_picpaths, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/
$ sudo docker run -it ubuntu bash
Unable to find p_w_picpath ‘ubuntu:latest’ locally
Pulling repository docker.io/library/ubuntu
a5a467fddcb8: Download complete
3fd0c2ae8ed2: Download complete
9e19ac89d27c: Download complete
ac65c371c3a5: Download complete
Status: Downloaded newer p_w_picpath for ubuntu:latest
docker.io/library/ubuntu: this p_w_picpath was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker.
转载于:https://blog.51cto.com/quietnight/1707602