In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install docker offline in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Prepare docker offline package
Docker official offline package download address
Download the version of docker that needs to be installed. What I download this time is
Docker-17.03.2-ce.tgz version
two。 Prepare the docker.service system profile
Docker.service [Unit] Description=Docker Application Container EngineDocumentation= https://docs.docker.comAfter=network-online.target firewalld.serviceWants=network-online.target [Service] Type=notify# the default is not to use systemd for cgroups because the delegate issues still# exists and systemd currently does not support the cgroup feature set required# for containers run by dockerExecStart=/usr/bin/dockerdExecReload=/bin/kill-s HUP $MAINPID# Having non-zero Limit*s causes performance problems due to accounting overhead# in the kernel. We recommend using cgroups to do container-local accounting.LimitNOFILE=infinityLimitNPROC=infinityLimitCORE=infinity# Uncomment TasksMax if your systemd version supports it.# Only systemd 226 and above support this version.#TasksMax=infinityTimeoutStartSec=0# set delegate yes so that systemd does not reset the cgroups of docker containersDelegate=yes# kill only the docker process, not all processes in the cgroupKillMode=process# restart the docker process if it exits prematurelyRestart=on-failureStartLimitBurst=3StartLimitInterval=60s [Install] WantedBy=multi-user.target
3. Prepare the installation script and uninstall script
Installation script install.sh
#! / bin/shecho 'unpack tar package...' tar-xvf $1echo 'move docker directory to / usr/bin directory...' cp docker/* / usr/bin/echo 'move docker.service to / etc/systemd/system/ directory...' cp docker.service / etc/systemd/system/echo 'add file permissions...' chmod + x / etc/systemd/system/docker.serviceecho 'reload configuration file.' systemctl daemon- Reloadecho 'Boot docker...'systemctl start dockerecho' setting Boot self... 'systemctl enable docker.serviceecho' docker installed successfully... 'docker-v
Uninstall script uninstall.sh
#! / bin/shecho 'Delete docker.service...'rm-f / etc/systemd/system/docker.serviceecho' Delete docker file...'rm-rf / usr/bin/docker*echo 'Reload configuration file' systemctl daemon-reloadecho 'unloaded successfully.
4. Installation
4.1 the directory is as follows: (you only need to follow docker-17.03.2-ce.tgz, docker.service, install.sh and uninstall.sh)
4.2 execute script sh install.sh docker-17.03.2-ce.tgz
The execution process is as follows:
After the script is executed, execute docker-v
It is found that docker has been successfully installed at this time. You can use docker-- help to check the docker command. From now on, you can install image and container yourself.
Sh uninstall.sh
4.3 if you want to uninstall docker, execute the script sh uninstall.sh at this time, as follows:
At this point, type docker-v and find that docker has been uninstalled
Thank you for reading! This is the end of this article on "how to install docker offline in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.