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

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/.
主站蜘蛛池模板: 淮滨县| 宾川县| 临清市| 棋牌| 讷河市| 平果县| 广水市| 芦溪县| 孟州市| 广丰县| 健康| 厦门市| 迁安市| 旺苍县| 昌邑市| 光山县| 通州区| 长沙市| 武平县| 马尔康县| 马鞍山市| 蒲城县| 昆山市| 楚雄市| 城市| 金寨县| 康平县| 仁怀市| 江都市| 石渠县| 黎城县| 中方县| 余庆县| 永靖县| 象山县| 嘉善县| 雅江县| 紫阳县| 曲阳县| 中卫市| 长宁区|