docker 指定版本rpm包安装
2024-10-12 11:36:00
1.docker rpm包下载地址
# https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
2.下载rpm包
# wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.06.0.ce-3.el7.x86_64.rpm
3.安装docker
# 下载阿里的docker-ce源
# cd /etc/yum.repos.d/ && wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # yum -y install docker-ce-18.06.0.ce-3.el7.x86_64.rpm
4.镜像加速配置
# mkdir -p /etc/docker/
# cat >/etc/docker/daemon.json<<EOF
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
EOF
5.指定docker目录启动
# vim /usr/lib/systemd/system/docker.service [Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
BindsTo=containerd.service
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
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 --graph /home/meisoo/docker --insecure-registry=172.17.29.74 -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=
RestartSec=
Restart=always # Note that StartLimit* options were moved from "Service" to "Unit" in systemd .
# Both the old, and new location are accepted by systemd and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst= # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd .
# Both the old, and new name are accepted by systemd 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 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 [Install]
WantedBy=multi-user.target
6.启动docker
systemctl start docker.service
7.查看docker版本
# docker version
Client:
Version: 18.06.-ce
API version: 1.38
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul ::
OS/Arch: linux/amd64
Experimental: false Server:
Engine:
Version: 18.06.-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul ::
OS/Arch: linux/amd64
Experimental: false
最新文章
- C# WinForm国际化的简单实现
- 分布式数据库的四分结构设计 BCDE
- EventBus 优化广播的传播
- CSS布局(一)
- django rest framework
- ubuntu下查看环境变量
- undefined reference to libiconv_open&#39;
- Android --http请求之HttpURLConnection
- (转)数据库SQL优化大总结之 百万级数据库优化方案
- MFC中CListCtrl说明
- ChatterBot之使用mongodb 03
- Spark学习之编程进阶总结(一)
- 【C++】VS2015/VS2017连接Mysql数据库教程
- IP通信基础学习第二周
- Maths | Metropolis-Hastings algorithm
- php 注册树(注册模式)
- JConsole连接远程linux服务器配置
- MATLAB SVM
- JAVA常见面试题之Forward和Redirect的区别 (转发和重定向)
- 【神仙题】【CF28D】 Don&#39;t fear, DravDe is kind