網頁

2017年1月30日 星期一

Docker 1.13.0 --- How to install Docker on Lubuntu 16.10 x64

For a long time no go deep into the Docker's Knowledge!
Due to the job rotation, I have to spend some time to mange team member so that no time to write down something. In the duration of the Chinese holiday, I go to the Docker's Official Website to read the related document(# 1) and find out the some knowledge is a little different with before learning.
I will follow up the Docker's document to re-learn the installation step. For avoiding the forget memory in my mind, I will summary something as follows:

To remove the old Docker component if we ever install Docker or the system build in
sudo apt-get purge lxc-docker

To install extra packages for allowing Docker to use the aufs storage drivers
$ sudo apt update
$ sudo apt install curl linux-image-extra-$(uname -r) linux-image-extra-virtual

To install Docker by using the Docker's repositories
For setting up the Docker repository, we need to install some packages to allow apt to use a repository over HTTPS
$ sudo apt install apt-transport-https ca-certificates
and add Docker's official GPG key
curl -fsSL https://yum.dockerproject.org/gpg | sudo apt-key add -

and add the record of the stable repository into the /etc/apt/sources.list
$ sudo add-apt-repository "deb https://apt.dockerproject.org/repo/ ubuntu-$(lsb_release -cs) main"

To update the apt package index
$ sudo apt update

To verify the apt pull from the right repository
$ apt-cache policy docker-engine

To install the latest version of Docker(# 2)
sudo apt install docker-engine

To check Docker is running
sudo systemctl status docker

To verify the Docker is installed correctly
$ sudo docker run hello-world


Reference
(# 1). Get Docker for Ubuntu
(# 2). If we want to install a specific version of Docker Engine, not the latest version, we can use apt-cache madison command to list all available version.
apt-cache madison docker-engine
next to choose the the appropriate version
$ sudo apt-get install docker-engine=1.13.0-0~ubuntu-yakkety
(# 3). If we want to manage Docker as a non-root user, we need to create the docker group and add the specific user into this group.
To create the docker group
$ sudo groupadd docker

To add a logon user to the docker group
$ sudo usermod -aG docker $USER
Log out and log back again so that we can use docker command without sudo now.
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.