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