Installing and using docker in Ubuntu

Time:2021-1-26

Docker is an open source application container engine based onGo languageAnd comply with Apache 2.0 protocol open source.

Docker allows developers to package their applications and dependency packages into a lightweight, portable container, and then publish them to any popular Linux machine. It also enables virtualization.

Containers use sandbox mechanism completely, and there is no interface between them (similar to iPhone app). What’s more, container performance overhead is very low.

Docker is divided into Ce (Community Edition) and EE (Enterprise Edition) after version 17.03. We can use Community Edition.

Update the apt source index of Ubuntu

sudo apt-get update

The installation package allows apt to use the repository via HTTPS
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 up docker stable version warehouse
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
After adding the warehouse, update apt source index

sudo apt-get update

Install the latest version of docker Ce (community version)

sudo apt-get install docker-ce

Enter root permission

su root-Enter the local password

View image

docker images

View the currently running container

docker ps

View the currently running container and the failed container

docker ps -a

Check that docker CE is installed correctly

sudo docker run hello-world

Start docker

sudo service docker start

Stop docker

sudo service docker stop

Restart docker

sudo service docker restart

Docker is opened by default after installation and can be used directly~~

Recommended Today

The basic components of angular2 learning notes and ngfor

The idea of angular2 is very advanced. It abandons the complex construction mode of angular1 and adopts the method of component-based prescription. Let’s take a look at what a basic component looks like.angular2-demo 1、 Introduction 1. Directory structure .tsComponent code .scssstyle .pngdesign sketch .htmltemplate file 2. Renderings 2、 Code instance https://github.com/qq83387856/angular2-demo/tree/master/src/ts/component/basic 3、 Detailed interpretation 1. […]