premise:
Start your day with a linux environment, linux environment for this article CentOS7, the installation process slightly
First, install Docker
Ali cloud or virtual machine installation
yum the install the sudo - Y yum - utils Device - Mapper - persistent - Data LVM2 [mounting system tools necessary]
yum sudo - config - Manager - the Add - repo HTTP : //mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo [information] to add software source
sudo yum makecache fast [cache] yum update
yum sudo - the y-install docker - ce [installation] docker Community Edition
sudo systemctl start docker [start] Docker
docker the Hello RUN - world [Test] docker installation
Tencent cloud installation
yum install docker-io -y [a] key installation
docker -v [version] to view the
official off-line installation method [official installation documentation: https: //docs.docker.com/install/linux/docker-ce/centos/#install -docker-ce-1]
1, the offline download Quguan network installation package https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ 2, successively download containerd.io-1.2.2-3.3 .el7.x86_64, docker-ce-cli- 19.03.4-3.el7.x86_64, docker-ce-19.03.4-3.el7.x86_64 [or later] 3, with xftp copy files to the recording server path . 4, the install the sudo yum / path /
containerd.io-1.2.2-3.3.el7.x86_64.rpm
. 5,the sudo yum the install / path /Docker-CE-CLI-19.03.4-3.el7.x86_64.rpm
. 6 , Yun the install the sudo / path /Docker-CE-19.03.4-3.el7.x86_64.rpm
Second, install Nginx
docker pull nginx [pull mirrored to a local official]
RUN Docker - name My-nginx - the p-80 : 80 - d nginx [backstage start nginx and rename my-nginx, port number mapped to 80] input Centos host ip address in the browser to see the nginx welcome page represents the start of normal [test] install nginx
Third, install dotnet core 2.2
docker microsoft [search] Microsoft's official image
docker pull microsoft/dotnet:2.2-aspnetcore-runtime 【安装.net core runtime】
Fourth, the installation Redis
Redis pull Docker : 3.2 [pulling] the official 3.2 version of Mirror
6379 RUN -p Docker: -v $ 6379 the PWD / Data : / Data --name My-Redis: 3.2 - D Redis : 3.2 Redis - Server - appendOnly Yes
Parameters:
-v $ the PWD / Data: / Data: The host data directory of the current loading of the container / data
-p 6379: 6379: mapping the port 6379 of the container 6379 to a host port
redis-server --appendonly yes: startup command execution container redis-server, and open the redis persistence configuration
Docker Exec - IT container ID redis - cli [ View redis if installed]
Docker installation problems may arise:
1, the installation docker prompt 404 prompts an error or a connection failure
Cause: The most likely source yum configuration issues docker can not download and install correctly
Solution:
a, enter cd /etc/repos.d
b, ls facie there is no docker-ce.repo file
c, re-edit this file
[docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://download.docker.com/linux/centos/7/$basearch/stable enabled=1 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg [docker-ce-stable-debuginfo] name=Docker CE Stable - Debuginfo $basearch baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/stable enabled=0 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg [docker-ce-stable-source] name=Docker CE Stable - Sources baseurl=https://download.docker.com/linux/centos/7/source/stable enabled=0 gpgcheck=1 gpgkey=https://download.docker.com/linux/centos/gpg [docker-ce-edge] name=Docker CE Edge - $basearch "docker-ce.repo" 83L, 2424C
d,: wq to save and exit, re-run yum install docker can be solved