ubuntu docker installation environment

Reprinted: https://www.cnblogs.com/blog-rui/p/9946382.html

1. Docker mounted in Ubuntu

Update apt source index of ubuntu

sudo apt-get update

Apt to allow the installation package repository over HTTPS, (following the complete copy command, and then pasted into the command window)

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

Add Docker official GPG key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Set Docker Stable warehouse

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

After adding warehouse, update apt source index

sudo apt-get update

Install the latest version Docker CE (Community Edition)

sudo apt-get install docker-ce

Check the Docker CE is installed correctly

sudo docker run hello-world

The following message appears indicating that the installation was successful

In order to avoid each input commands sudo, you can set user privileges, attention must log out again after execution

sudo usermod -a -G docker $USER

2. Start and stop

After the installation is complete Docker, the default service has been launched docker

To manually start and stop control docker services, run the following command

Copy the code
# Start Docker 
sudo Service Docker Start 

# stop Docker 
sudo Service Docker STOP 

# restart Docker 
sudo Service Docker restart
Copy the code

3. Docker mirroring operation

 

Guess you like

Origin www.cnblogs.com/hansjorn/p/11666285.html