1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
\r
2 .. http://creativecommons.org/licenses/by/4.0
\r
3 .. Copyright 2017 Huawei Technologies Co., Ltd.
\r
8 Make sure curl is installed on the Ubuntu VM:
\r
10 .. code-block:: bash
\r
13 sudo apt install curl
\r
15 If you are behind a corporate firewall (replace "proxyhost:port" with your actual proxy information)
\r
16 https_proxy="https://*proxyhost:port*" curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
\r
19 curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
\r
22 Add the docker package repository:
\r
23 sudo apt-add-repository "deb https://apt.dockerproject.org/repo ubuntu-xenial main"
\r
27 .. code-block:: bash
\r
30 sudo apt-cache policy docker-engine
\r
31 sudo apt install docker-engine
\r
32 sudo apt install docker-compose
\r
34 If you are behind a corporate firewall, you will need to configure proxy settings for docker so that images may be obtained from internet repositories. In the commands shown here, replace *"proxyhost:port"*, *"yourdomain1.com"*, and *"yourdomain2.com"* with appropriate values.
\r
36 Make the docker configuration directory:
\r
38 .. code-block:: bash
\r
40 sudo mkdir -p /etc/systemd/system/docker.service.d
\r
42 Edit (create) this file:
\r
44 .. code-block:: bash
\r
46 sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
\r
52 Environment="HTTP_PROXY=https://*proxyhost:port*"
\r
54 Environment="HTTPS_PROXY=https://*proxyhost:port*"
\r
56 Environment="NO_PROXY=localhost,127.0.0.1,.yourdomain1.com,.yourdomain2.com"
\r
60 .. code-block:: bash
\r
62 sudo systemctl daemon-reload
\r
63 sudo systemctl restart docker
\r
65 Add yourself to the docker user group (replace "userid" with your user ID):
\r
67 .. code-block:: bash
\r
69 sudo usermod -a -G docker *userid*
\r
71 Log out and log back in so that the user group change will takeeffect.
\r
73 Verify that you can connect to docker as yourself (i.e. not as root):
\r
75 .. code-block:: bash
\r
79 Verify that you can download and run the hello-world container
\r
81 .. code-block:: bash
\r
83 docker run hello-world
\r
85 .. image:: images/Docker_install_1.png