This is the 14th day of my participation in the August More Text Challenge. For details, see:August is more challenging

This article first switches to the root user based on CentOS7

.

Install docker-ce(CommunityEdition).

Find through yum

The default is to find a version older than 1.13.1

yum list docker**

yum list docker-ce

There is no docker-CE package, because the default source of CentOS7 does not hold the docker-CE package

Docker yum repo has not been added yet

Add docker repo as user root

yum-config-manager —add-repo Download.docker.com/linux/cento…

Ok, try to find the Docker community version, the current stability to the community version 20.10.2

Add -y to yum to confirm the installation of other dependency packages.

yum install -y docker-ce

To view the Docker version, execute

docker -v

Try to find an image or look at the running container and find “Cannot connect to Docker daemon at docker.sock”

Start dockerd (docker daemon) and add boot.

systemctl start docker

Systemctl enable docker # Start dockerd

Systemctl status docker # check dockerd or: ps – ef | grep docker

The installation ends here.

Try the docker command

No docker Container processes are currently running.

Find the official Hello-World image and run it.

Docker search the hello world – | head – 5 # 5 lines, first four hello – world mirror

Here are the results:

Docker pull hello-world # pull the first official image

Docker Images # View local cache into images

Run the first Docker image: Hello-world, and see the container already running

docker run hello-world

docker ps

Because the image is just to show the output “Hello from Docker” and the help information related to getting started with Docker, as shown above.

Use a container to run ubuntu in the background

Docker run -it Ubuntu bash

This command starts Ubuntu within a container process and goes directly to the bash console.

Use the background boot mode (-d) to run an Ubuntu system inside the container.

docker run -it -d ubuntu

You can forward commands from a container to a specific container, such as to view system information:

docker exec  735abdacd166 uname -a

I’ll leave you there, take a break, and continue studying later.

Continuous learning and continuous development, I am the Lei School committee! Programming is fun, but the key is to get the technology straight. Creation is not easy, please support a lot, click like collection to support the school committee!

Refer to the link

Systemctl using: www.cnblogs.com/dyh004/p/66…

Docker related: docs.docker.com/get-started… & https://hub.docker.com