Docker 安装(Install Docker Engine from binaries)

文章目录

  • 前言
  • 一、下载文件
  • 二、解压
  • 配置 systemd 启动(Configure the daemon with systemd)
    • docker.service
    • daemon.json
  • 启动
  • 总结


前言

使用二进制包方式安装docker 。


一、下载文件

下载地址:

https://download.docker.com/linux/static/stable/

我下载的是 docker-20.10.8.tgz

二、解压

当前账号已经有 root 权限

tar  -zxvf   docker-20.10.8.tgz

复制到 /usr/bin/

 mv   docker/*    /usr/bin/

配置 systemd 启动(Configure the daemon with systemd)

docker.service

创建文件

/etc/systemd/system/docker.service

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service containerd.service time-set.target
Wants=network-online.target containerd.service
# Requires=docker.socket    可以不使用[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
TimeoutStartSec=0
RestartSec=2
Restart=always# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s# 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# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
# TasksMax=infinity# 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
# OOMScoreAdjust=-500[Install]
WantedBy=multi-user.target

daemon.json

创建镜像地址

mkdir   /home/docker

创建
/etc/docker/daemon.json

data-root 镜像地址
registry-mirrors 镜像源

{"data-root": "/home/docker","registry-mirrors": ["https://改成自己.mirror.aliyuncs.com"]
}

启动

sudo systemctl start docker

系统启动自运行

sudo systemctl enable docker.service

总结

如果修改配置文件后启动报错,

Warning: The unit file, source configuration file or drop-ins of docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.

解决方式:
先运行

sudo systemctl daemon-reload

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/11676.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

代码随想录算法训练营day53 1143.最长公共子序列 1035.不相交的线 53.最大子序和

题目链接1143.最长公共子序列 class Solution {public int longestCommonSubsequence(String text1, String text2) {char[] char1 text1.toCharArray();char[] char2 text2.toCharArray();int[][] dp new int[text1.length()1][text2.length()1];for(int i 1; i < tex…

【语音识别】- 声学,词汇和语言模型

一、说明 语音识别是指计算机通过处理人类语言的音频信号&#xff0c;将其转换为可理解的文本形式的技术。也就是说&#xff0c;它可以将人类的口语语音转换为文本&#xff0c;以便计算机能够进一步处理和理解。它是自然语言处理技术的一部分&#xff0c;被广泛应用于语音识别助…

项目播报 | 新基德携手璞华易研PLM,打造企业新一代研发管理平台

近日&#xff0c;“新基德PLM&#xff08;Product Lifecycle Management&#xff0c;产品生命周期管理&#xff09;项目”在新基德&#xff08;深圳&#xff09;电子有限公司&#xff08;以下简称&#xff1a;新基德&#xff09;正式启动。新基德是一家集手机研发、生产、销售、…

基于深度学习的高精度六类海船检测识别系统(PyTorch+Pyside6+YOLOv5模型)

摘要&#xff1a;基于深度学习的高精度六类海船检测识别系统可用于日常生活中检测与定位海船目标&#xff08;散装货船&#xff08;bulk cargo carrier&#xff09;、集装箱船&#xff08;container ship&#xff09;、渔船&#xff08;fishing boat&#xff09;、普通货船&…

react实现markdown

参考&#xff1a;https://blog.csdn.net/Jack_lzx/article/details/118495763 参考&#xff1a;https://blog.csdn.net/m0_48474585/article/details/119742984 1.基本布局及样式 <><div classNametf_editor_header>头部&#xff1a;放一些编辑工具</div>&…

【Docker】Docker Compose的配置与部署

文章目录 一、Docker Compose1. Docker Compose 的概述2. Docker Compose 三大的概念3. Docker Compose 环境安装二、YAML 文件格式及编写注意事项1. YAML 文件格式2. YAML 格式的注意事项3. YAML 数据结构3.1 基本类型3.2 实例3.3 YAML 特殊类型文本块锚点与引用三、Docker Co…

JAVA面试总结-Redis篇章(四)——双写一致性

JAVA面试总结-Redis篇章&#xff08;四&#xff09;——双写一致性 问&#xff1a;redis 做为缓存&#xff0c;mysql的数据如何与redis进行同步呢&#xff1f;第一种情况&#xff0c;如果你的项目一致性要求高的话 采用以下逻辑我们应该先删除缓存&#xff0c;再修改数据库&…

栈粉碎原理分析

栈粉碎原理分析 源代码如下 #include <stdio.h>void function(int a, int b) {char buffer[12];gets(buffer);//long* ret (long *) ((long)buffer28);//*ret *ret 7;return; }void main() {int x;x 0;function(1,2);x 1;printf("%d\n",x); } 由解注释前…

深入浅出Pytorch函数——torch.Tensor.backward

分类目录&#xff1a;《深入浅出Pytorch函数》总目录 相关文章&#xff1a; 深入浅出Pytorch函数——torch.Tensor 计算当前张量相对于图的梯度&#xff0c;该函数使用链式法则对图进行微分。如果张量不是一个标量&#xff08;即其数据具有多个元素&#xff09;并且需要梯度&a…

qt服务器 网络聊天室

widget.cpp #include "widget.h" #include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget) {ui->setupUi(this);//给服务器指针实例化空间server new QTcpServer(this); }Widget::~Widget() {delete ui; }//启动…

暴力猴插件简明开发教程->百度首页默认设置为我的关注

文章目录 暴力猴插件开发简明教程->百度首页默认设置为我的关注缘起缘灭思路实现尾声 暴力猴插件开发简明教程->百度首页默认设置为我的关注 缘起 在我的百度首页有很多自己设置的导航链接(接近100个),里面放了我常用的网站, 如下图 但是最近一段时间, 我发现百度做了一…

智能合约安全审计

智能合约安全审计的意义 智能合约审计用于整个 DeFi 生态系统&#xff0c;通过对协议代码的深入审查&#xff0c;可以帮助解决识别错误、低效代码以及这些问题。智能合约具有不可篡改的特点&#xff0c;这使得审计成为任何区块链项目安全流程的关键部分。 代码审计对任何应用…

[SQL挖掘机] - 右连接: right join

介绍: 右连接是一种多表连接方式&#xff0c;它以右侧的表为基础&#xff0c;并返回满足连接条件的匹配行以及右侧表中的所有行&#xff0c;即使左侧的表中没有匹配的行。右连接将右表的每一行与左表进行比较&#xff0c;并根据连接条件返回结果集。其实, 左连接和右连接原理一…

【牛客面试必刷TOP101】Day1.反转链表和合并两个排序的链表

作者简介&#xff1a;大家好&#xff0c;我是未央&#xff1b; 博客首页&#xff1a;未央.303 系列专栏&#xff1a;牛客面试必刷TOP101 每日一句&#xff1a;人的一生&#xff0c;可以有所作为的时机只有一次&#xff0c;那就是现在&#xff01;&#xff01;&#xff01;&…

详细分析Python中运算符“==“和“is“的区别

目录 Python中运算符"" Python中运算符"is" ""和"is"的区别 总结 Python中运算符"" 在Python中&#xff0c;双等号运算符"" 用于比较两个值是否相等。它返回一个布尔值&#xff0c;即True或False&#xff0c;…

C# 使用opencv从图片识别人脸示例

1.用chatgpt帮我写了一个示例 using System; using Emgu.CV; using Emgu.CV.CvEnum; using Emgu.CV.Structure;class Program {static void Main(string[] args){// 加载人脸分类器CascadeClassifier faceCascade new CascadeClassifier("haarcascade_frontalface_defau…

JenKins工作流程

程序员提交代码到Git/SVN仓库&#xff0c;触发钩子程序向 JenKins 进行通知&#xff0c;Jenkins 调用Git/SVN插件获取源码&#xff0c;调用Maven打包为war包&#xff0c;调用Deploy to web container插件部署到Tomcat服务器。

Redis哨兵模式

Redis哨兵模式 一、服务器准备二、安装redis1.Master服务器2.SlaveFirst服务器3.SlaveSecond服务器 三、依次开启Redis服务器四、开启哨兵1.修改Master哨兵配置文件2.修改SlaveFirst哨兵配置文件3.修改SlaveSecond哨兵配置文件4.开启哨兵5.验证是否开启成功6.主从配置如下五、挂…

【替换】批量替换命令文件名称或者文件内容

你是否困扰过&#xff0c;每次文件F2进行修改&#xff0c;十几个没关系&#xff0c;百来个写代码麻烦&#xff0c;那就使用shell命令吧 执行语句 先养成习惯查询验证&#xff0c;因为是批量替换&#xff0c;为了防止全局替换嘎嘎叫 替换文件名 # 【习惯】先使用顾虑查询&…

layui 设置选中时间为当天时间最大值23:59:59、laydate设置选中时间为当天时间最大值23:59:59

既是涨知识的一天&#xff0c;又是干前端的一天&#xff01; laydate.render({ elem: #validityPeriod, //type: datetime,//类型要一定要相匹配 type: date, // 设置日期选择模式 trigger: click, format: yyyy-MM-dd HH:mm:ss, // 设置日期的显示格式 min: startDate, max: …