This article is a mirror article of machine translation, please click here to jump to the original article.

View: 16310|Reply: 1

[linux] Centos7 Docker installation and configuration in practice

[Copy link]
Posted on 8/24/2018 1:29:40 PM | | | |
Basic concepts

Docker includes three basic concepts

Image
Container
Repository
Once you understand these three concepts, you understand the entire lifecycle of Docker.

Deploy the environment

CentOS Linux release 7.5.1804 (Core)
Docker Version 1.13.1

1. Docker installation and startup

Install docker

Set up boot



docker service starts and stops

# Basic information viewing

[root@VM_0_9_centos ~]# docker version
Client:
Version:         1.13.1
API version:     1.26
Package version: docker-1.13.1-74.git6e3bb8e.el7.centos.x86_64
Go version:      go1.9.4
Git commit:      6e3bb8e/1.13.1
Built:           Tue Aug 21 15:23:37 2018
OS/Arch:         linux/amd64

Server:
Version:         1.13.1
API version:     1.26 (minimum version 1.12)
Package version: docker-1.13.1-74.git6e3bb8e.el7.centos.x86_64
Go version:      go1.9.4
Git commit:      6e3bb8e/1.13.1
Built:           Tue Aug 21 15:23:37 2018
OS/Arch:         linux/amd64
Experimental:    false

2. Acquisition of images and use of containers

docker run and docker create parameters are basically the same,run creates the container and starts it in the background, and create only creates the container
docker run is equivalent to docker create and docker start


Container resource limit parameters

docker containers automatically start parameters with the system
no – Default, if the container hangs, it will not restart automatically
on-failure – Restart the container when it exits with a non-0 code
    An optional maximum number of reboots parameter (e.g. on-failure:5) can also be accepted.
always – Restart regardless of the exit code

View container status information


3. Docker to install dotnet

Image repository address:The hyperlink login is visible.

Download the image


List docker images that are already available locally




View the mirror details


Create containers using mirrors

The following command starts a bash terminal (For a created bash container, when you exit using the exit command, the container will automatically be terminated

Run the command below and see if the dotnet core environment is fine



Enter exit the container.
Lists all currently running containers
docker ps

In the next article, I will deploy the dotnet project to docker to run

(End)





Previous:Docker versions are divided into CE and EE distinctions
Next:Eight real-world Docker use cases
Posted on 6/25/2019 5:23:22 PM |
In the next article, I will put the dotnet project on docker and run this chapter
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com