您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關Centos7如何離線安裝Docker,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
docker包下載地址
#下載docker-20.10.0包 https://download.docker.com/linux/static/stable/x86_64/docker-20.10.0.tgz #上傳到Centos系統/data/目錄,如 scp docker-20.10.0.tgz root@192.168.0.5:/data/ #進入data目錄,解壓docker包 cd /data tar -zxvf docker-20.10.0.tgz #將解壓出來的docker文件內容移動到 /usr/bin/ 目錄下 cp docker/* /usr/bin/ #查看docker版本 docker version #查看docker信息 docker info
#添加docker.service文件 vi /etc/systemd/system/docker.service #按i插入模式,復制如下內容:
[Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=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 docker ExecStart=/usr/bin/dockerd ExecReload=/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=infinity LimitNPROC=infinity LimitCORE=infinity # Uncomment TasksMax if your systemd version supports it. # Only systemd 226 and above support this version. #TasksMax=infinity TimeoutStartSec=0 # 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 # restart the docker process if it exits prematurely Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target
#添加文件可執行權限 chmod +x /etc/systemd/system/docker.service #重新加載配置文件 systemctl daemon-reload #啟動Docker systemctl start docker #查看docker啟動狀態 systemctl status docker #查看啟動容器 docker ps #設置開機自啟動 systemctl enable docker.service #查看docker開機啟動狀態 enabled:開啟, disabled:關閉 systemctl is-enabled docker.service
關于“Centos7如何離線安裝Docker”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。