标签 - 容器

docker 容器    2016-03-12 18:18:43    428    0    0

安装Docker

在Linux系统上,可以通过两种方式。

方式一:安装docker-engine

方式二:直接通过curl安装

curl -fsSL https://get.docker.com/ | sh

curl如果没有安装,则需要先安装curl
这种方式安装成功之后,会自动启动docker

运行Docker

docker启动之后,可以通过docker run命令来运行镜像。

运行镜像

Hello world

docker run hello-world

运行举例:

root@mine:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
03f4658f8b78: Already exists 
a3ed95caeb02: Already exists 
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest

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.
 3. The Docker daemon created a new container from that image which runs