官术网_书友最值得收藏!

Installation of Docker

Docker is available in two editions, Community Edition (CE) and Enterprise Edition (EE):

  • Docker Community Edition (CE): It is ideal for developers and small teams looking to get started with Docker and may be experimenting with container-based apps
  • Docker Enterprise Edition (EE): It is designed for enterprise development and IT teams who build, ship, and run business critical applications in production at scale

This section will demonstrate the instructions for installing Docker CE on Ubuntu 16.04. The Docker installation package, available in the official Ubuntu 16.04 repository, may not be the latest version. To get the latest and greatest version, install Docker from the official Docker repository. This section shows you how to do just that:

  1. First, add the GPG key for the official Docker repository to the system:
        $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg |
sudo apt-key add
  1. Add the Docker repository to APT sources:
        $ sudo add-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  1. Next, update the package database with the Docker packages from the newly added repository:
        $ sudo apt-get update  
  1. Make sure you are about to install Docker repository instead of the default Ubuntu 16.04 repository:
        $ apt-cache policy docker-ce  
  1. You should see an output similar to the following:
        docker-ce:
          Installed: (none)
          Candidate: 17.06.0~ce-0~ubuntu
          Version table:
             17.06.0~ce-0~ubuntu 500
                500 https://download.docker.com/linux/ubuntu xenial/stable 
amd64 Packages 17.03.2~ce-0~ubuntu-xenial 500 500 https://download.docker.com/linux/ubuntu xenial/stable
amd64 Packages 17.03.1~ce-0~ubuntu-xenial 500 500 https://download.docker.com/linux/ubuntu xenial/stable
amd64 Packages 17.03.0~ce-0~ubuntu-xenial 500 500 https://download.docker.com/linux/ubuntu xenial/stable
amd64 Packages

Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 16.04. The docker-ce version number might be different.

  1. Finally, install Docker:
        $ sudo apt-get install -y docker-ce  
  1. Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it's running:
        $ sudo systemctl status docker
        docker.service - Docker Application Container Engine
           Loaded: loaded (/lib/systemd/system/docker.service; enabled; 
vendor preset: enabled) Active: active (running) since Sun 2017-08-13 07:29:14 UTC; 45s
ago Docs: https://docs.docker.com Main PID: 13080 (dockerd) CGroup: /system.slice/docker.service ├─13080 /usr/bin/dockerd -H fd:// └─13085 docker-containerd -l
unix:///var/run/docker/libcontainerd/docker-containerd.sock --
metrics-interval=0 --start
  1. Verify that Docker CE is installed correctly by running the hello-world image:
        $ sudo docker run hello-world 
        Unable to find image 'hello-world:latest' locally 
        latest: Pulling from library/hello-world 
        b04784fba78d: Pull complete 
        Digest:
sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26
ff74f 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:
The Docker client contacted the Docker daemon
The Docker daemon pulled the hello-world image from the Docker Hub
The Docker daemon created a new container from that image,
which ran the executable that produced the output you are
currently reading
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 the following:
$ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID:
https://cloud.docker.com/
For more examples and ideas,
visit: https://docs.docker.com/engine/userguide/.
主站蜘蛛池模板: 那曲县| 甘孜县| 林甸县| 呈贡县| 新蔡县| 巴彦县| 万盛区| 万年县| 额济纳旗| 加查县| 安庆市| 祥云县| 砀山县| 廉江市| 凤阳县| 临西县| 成武县| 长宁县| 加查县| 彭水| 岳阳县| 新津县| 保定市| 卓资县| 阿荣旗| 三明市| 华宁县| 南郑县| 盘山县| 云和县| 高陵县| 嘉定区| 肇东市| 格尔木市| 康乐县| 嘉峪关市| 东乌珠穆沁旗| 江门市| 兰西县| 棋牌| 镇坪县|