当前位置:   article > 正文

docker 安装_docker 18.09.0 安装

docker 18.09.0 安装

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).

  1. cp docker/* /usr/sbin/
  2. ###########/or/###########
  3. vim /etc/profile
  4. export DOCKER_HOME=docker path
  5. export PATH=$PATH:$DOCKER_HOME
  6. 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

  1. [Unit]
  2. Description=Docker Application Container Engine
  3. Documentation=https://docs.docker.com
  4. After=network-online.target firewalld.service
  5. Wants=network-online.target
  6. [Service]
  7. Type=notify
  8. EnvironmentFile=-/etc/sysconfig/docker
  9. EnvironmentFile=-/etc/sysconfig/docker-storage
  10. EnvironmentFile=-/etc/sysconfig/docker-network
  11. Environment=GOTRACEBACK=crash
  12. ExecStart=/usr/bin/dockerd $OPTIONS \
  13. $DOCKER_STORAGE_OPTIONS \
  14. $DOCKER_NETWORK_OPTIONS \
  15. $INSECURE_REGISTRY
  16. ExecReload=/bin/kill -s HUP $MAINPID
  17. LimitNOFILE=1048576
  18. LimitNPROC=1048576
  19. LimitCORE=infinity
  20. # set delegate yes so that systemd does not reset the cgroups of docker containers
  21. Delegate=yes
  22. # kill only the docker process, not all processes in the cgroup
  23. KillMode=process
  24. [Install]
  25. WantedBy=multi-user.target

Add script execution permissions, reload system service configuration

  1. chmod +x /etc/systemd/system/docker.service
  2. 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.

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

The above configuration is complete, simple and fast.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/730637
推荐阅读
相关标签
  

闽ICP备14008679号