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

Docker环境离线安装-linux服务器

Linux环境下离线安装docker环境

  • 1. 下载 docker安装包
  • 2. 上传到服务器
  • 3. 解压 安装包
  • 4. 将解压文件移动到 /usr/bin 目录下
  • 5. 编写启动服务
  • 6. 设置开机自启
  • 7. 验证

1. 下载 docker安装包

进入官网 https://download.docker.com/linux/static/stable/x86_64/
在这里插入图片描述
选择版本进行下载。

2. 上传到服务器

3. 解压 安装包

tar -xzf docker-.tgz

4. 将解压文件移动到 /usr/bin 目录下

sudo mv docker/* /usr/bin/

5. 编写启动服务

vi /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

6. 设置开机自启

chmod +x /etc/systemd/system/docker.service #设置权限
systemctl daemon-reload
systemctl start docker #启动Docker
systemctl enable docker.service #设置开机自启

7. 验证

systemctl status docker #查看Docker状态
docker -v #查看Docker版本

http://www.dtcms.com/a/532404.html

相关文章:

  • 软件设计师知识点总结:结构化开发
  • 持续改变源于团队学习
  • Unity安装newtonsoft
  • Spring Boot3零基础教程,整合 Redis,笔记69
  • 凡科网站官网登录入口wordpress 列表模板
  • 读论文AI prompt
  • 《Ionic 平台:全面解析与深入探讨》
  • 网站做淘宝客有什么要求微网站的优势
  • FFmpeg 基本数据结构 AVStream分析
  • kafka数据同步一致性问题
  • 淘宝网站的建设内容网站建设的平台
  • Linux进程间通信:管道与System V IPC的全解析
  • 技术选型对比:几种主流方案获取淘宝商品实时数据的优劣分析
  • 想象力网站建设深圳市房地产信息系统平台
  • 让 Codex 用 React 生成一个博客首页
  • Kafka的概念
  • 开发实战 - ego商城 - 补充:小程序性能优化
  • 如何截取PDF内容为图片
  • 智慧景区导览小程序
  • 58同城企业网站怎么做的wordpress 评论设计
  • 珠海建站模板怎么做多语言网站
  • 致敬哈耶克,让灯火照亮个人前行的道路
  • 【LeetCode100】--- 96.只出现一次的数字【思维导图+复习回顾】
  • 网络编程Socket套接字
  • 算法基础篇(9)倍增与离散化
  • 搓了一个Deepin15的兼容环境(也支持Deepin20/23)
  • C++ - C++11拓展
  • php 装修网站柳州搜索引擎营销平台
  • Householder变换:线性代数中的镜像反射器
  • 【AI智能体】Coze 打造励志图文智能体应用实战操作详解