当前位置: 首页 > news >正文

linux系统离线安装docker服务教程

1、下载、上传docker-20.10.0.tgz压缩包至服务器,其中,docker下载地址https://download.docker.com/linux/static/stable/x86_64/

2、新建安装docker脚本docker-install.sh

#!/usr/bin/env bash
tar -xvf docker-20.10.0.tgzcp docker/* /usr/bin/cat <<-EOF >/etc/systemd/system/docker.service
[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
EOFchmod +x /etc/systemd/system/docker.servicesystemctl daemon-reloadsystemctl start dockersystemctl enable docker.servicedocker -v

3、运行脚本

root@ubuntu:/# ./docker-install.sh 
docker/
docker/containerd
docker/docker-init
docker/ctr
docker/containerd-shim
docker/containerd-shim-runc-v2
docker/runc
docker/docker-proxy
docker/dockerd
docker/docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /etc/systemd/system/docker.service.
Docker version 20.10.0, build 7287ab3

4、运行结果

root@ubuntu:/# systemctl status docker
● docker.service - Docker Application Container EngineLoaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: enabled)Active: active (running) since Tue 2024-02-20 22:53:18 PST; 10s agoDocs: https://docs.docker.comMain PID: 7145 (dockerd)Tasks: 21 (limit: 4646)CGroup: /system.slice/docker.service├─7145 /usr/bin/dockerd└─7168 containerd --config /var/run/docker/containerd/containerd.toml --log-level infoFeb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.149432511-08:00" level=warning msg="Your kernel does not support CPU realtime scheduler"
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.149442663-08:00" level=warning msg="Your kernel does not support cgroup blkio weight"
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.149448355-08:00" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.149727745-08:00" level=info msg="Loading containers: start."
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.402469679-08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.18.0.0/16. Daemon option --bip can be used to s
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.565861504-08:00" level=info msg="Loading containers: done."
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.704370268-08:00" level=info msg="Docker daemon" commit=eeddea2 graphdriver(s)=overlay2 version=20.10.0
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.704532504-08:00" level=info msg="Daemon has completed initialization"
Feb 20 22:53:18 ubuntu systemd[1]: Started Docker Application Container Engine.
Feb 20 22:53:18 ubuntu dockerd[7145]: time="2024-02-20T22:53:18.793607753-08:00" level=info msg="API listen on /var/run/docker.sock"
http://www.lryc.cn/news/304179.html

相关文章:

  • 【青龙】快速搭建青龙面板,部署属于你自己的应用!
  • shell脚本实现Mysql分库分表备份
  • 【算法 - 动态规划】从零开始学动态规划!(总纲)
  • 从 Elasticsearch 到 Apache Doris,统一日志检索与报表分析,360 企业安全浏览器的数据架构升级实践
  • 【力扣 - 二叉树的直径】
  • 大数据,对于生活的改变
  • py2neo和neo4j
  • 解决windows无法访问wsl下docker服务
  • OpenAI划时代大模型——文本生成视频模型Sora作品欣赏(二)
  • Python第十九章(模块)
  • 【Linux网络编程五】Tcp套接字编程(四个版本服务器编写)
  • APP 有漏洞被测要下架,怎么处理?
  • 2024年2月19日-2月25日(全面进行+收集免费虚幻商城资源)
  • Flutter学习4 - Dart数据类型
  • leetcode hot100单词拆分
  • 大数据构建知识图谱:从技术到实战的完整指南
  • WebServer -- 定时器处理非活动连接(上)
  • 微服务部署:金丝雀发布、蓝绿发布和滚动发布的对比
  • 轻松入门MySQL:优化复杂查询,使用临时表简化数据库查询流程(13)
  • vmware的ubuntu虚拟机因空间满无法启动
  • Unity数据持久化之PlayerPrefs
  • uniapp微信公众号H5分享
  • 深入理解指针(c语言)
  • 高级语言期末2015级唐班B卷
  • 开发一款招聘小程序需要具备哪些功能?
  • 嵌入式学习-qt-Day3
  • 零基础到高级:Android音视频开发技能路径规划
  • 阿里云香港轻量应用服务器网络线路cn2?
  • python中websockets与主线程传递参数
  • js谐音梗创意小游戏《望子成龙》