docker 安装

Posted GE12

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker 安装相关的知识,希望对你有一定的参考价值。

Introduction

About the operating system

View the kernel version number

  

uname -r


View linux release version

cat /etc/readhat-release

About Docker installation

You can use yum, rpm, sound core, binary system, etc. If there is network support, then installing Docker must be like a fish in the water.

For offline installation, one of the first three methods is too time-consuming; the other one cannot find the corresponding rpm package at all; the last one is more difficult to deploy and highly error-prone; I decisively chose the fourth method to install.

Download the Docker source package of the ARM architecture

Official website binary installation reference manual:https://docs.docker.com/engine/install/binaries/

Click ==>Download address of Docker stable version of ARM architecture<==Choose the corresponding version to download.

Linux download

wget https://download.docker.com/linux/static/stable/aarch64/docker-18.09.0.tgz

Windows can be transferred to the server through lrzsz tool or other means.

Configure Docker

Unzip

 tar xf docker-18.09.0.tgz 

View the unzipped directory


These are executable files, you only need to configure the PATH variable and you can use it directly. Regarding the configuration of the PATH variable, you can choose to copy the file to the addressing path of the PATH variable or edit the global variable profile (profile).

cp docker/* /usr/sbin/
###########/or/###########
vim /etc/profile
export DOCKER_HOME=docker path
export PATH=$PATH:$DOCKER_HOME
source /etc/profile

Verify that Docker is available

docker -v

Add Docker as a system service

Edit a Docker system service file

vi /usr/lib/systemd/system/docker.service

Add the following content inside

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash

ExecStart=/usr/bin/dockerd $OPTIONS \\
                           $DOCKER_STORAGE_OPTIONS \\
                           $DOCKER_NETWORK_OPTIONS \\
                           $INSECURE_REGISTRY
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process

[Install]
WantedBy=multi-user.target

Add script execution permissions, reload system service configuration

chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload

Verify configuration

Start docker

systemctl start docker

Will be configured to start at boot

Note: This command will most likely report an error, and the command will not be executed successfully

systemctl enable docker

If the execution of the above command is unsuccessful, you can choose another solution to configure the auto-start after booting, and there is no need to solve it.

Add the command to the rc.local file and configure the auto-start after booting.

echo "systemctl start docker" > /etc/rc.local
chmod +x /etc/rc.local

The above configuration is complete, simple and fast.

以上是关于docker 安装的主要内容,如果未能解决你的问题,请参考以下文章

shell bash如何判断docker是否安装(检测docker安装检查docker安装docker版本)

ubuntu 安装docker

docker 安装 leanote

CentOS8.1安装docker

Docker安装教程

docker中mysql安装位置