首页 > 其他分享 >docker离线安装手册

docker离线安装手册

时间:2022-11-29 12:16:15浏览次数:42  
标签:bin systemd old 离线 手册 version https docker

docker 下载链接:
https://download.docker.com/linux/static/stable/x86_64/

 

解压:

tar xf docker-20.10.9.tgz

 

拷贝命令到指定目录:

cp -a * /usr/bin/

 

编写docker配置:

mkdir /etc/docker
cat << 'EOF' > /etc/docker/daemon.json、

{
    "log-driver": "json-file",
    "data-root": "/data/docker",
    "log-opts": {
      "max-size": "100m",
      "max-file": "3"
     },
     "exec-opts": ["native.cgroupdriver=systemd"],
     "storage-driver": "overlay2",
     "storage-opts": [
        "overlay2.override_kernel_check=true"
     ],
     "insecure-registries": [
       "192.168.1.200:80"
     ],
     "registry-mirrors": [
       "https://docker.mirrors.ustc.edu.cn",
       "https://hub-mirror.c.163.com"
     ]
}
EOF

 

添加启动脚本:

cat << EOF > /usr/lib/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
TimeoutSec=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
EOF

 

启动docker:
systemctl daemon-reload
systemctl enable docker # 开机启动docker
systemctl start docker # 启动docker服务

 

查看docker是否安装成功:
docker info

 

标签:bin,systemd,old,离线,手册,version,https,docker
From: https://www.cnblogs.com/weipan/p/16935043.html

相关文章

  • Ubuntu离线源制作
    1.离线制作机操作1.1下载软件包及其依赖cd/var/cache/apt/archivesapt-getdownload$(apt-cachedepends--recurse--no-recommends--no-suggests--no-conflict......
  • docker exec -it xxxx bash 报错
    1、报错信息rpcerror:code=2desc=ociruntimeerror:execfailed:container_linux.go:235:startingcontainerprocesscaused"exec:\"bash\":executablefile......
  • 软件离线许可(License)实现原理
    我们经常使用各种开发软件,比如IntelliJIDEA、Navicat、VisualStudio等,这些软件都有一个特点,就是要收费。一般是我们需要去购买一个许可,然后输入这个许可到软件里就能够......
  • Linux(CentOS) Docker 部署Logstash (sqlserver 同步到Elasticsearch)
    网上搜了一下基本都是mysql同步到elasticsearch的案例,虽然没有Sqlserver得案例,但是想一下步骤也大致相同。1.拉取镜像使用以下命令拉去与elasticsearch版本一致logstas......
  • 001 Dockerfile的基础
    由于linux操作系统的版本不支持安装docker重新安装系统后可能之前的服务就不能用了,所以直接找了台已经安装好的服务器172.16.70.49-docker用户名:root密码:xxxx  ......
  • 002 安装docker-放弃
    1、查看是否已安装docker#yumlistinstalled|grepdocker2、安装docker#yum-yinstalldocker  是不是已经安装成功了?3、启动docker  啊哦,怎么安......
  • 003docker的安装常识
    https://www.cnblogs.com/xiaolei123/p/11918450.html早看到这篇文章就好了o(╥﹏╥)o二:安装要求      1.64位操作系统      2.至少RHEL6.5版本以上,个人强......
  • 3.6 Docker最新入门教程-Docker入门-使用绑定挂载
    3.6使用绑定挂载在上一章中,我们讨论并使用命名卷来持久化数据库中的数据。如果我们只想存储数据,命名卷就很棒,因为我们不必担心数据存储在哪里。使用绑定挂载,我们可以控......
  • 3.5 Docker最新入门教程-Docker入门-持久化数据库
    3.5持久化数据库您是否注意到,每次我们启动容器时,我们的待办事项列表都会被清除干净。为什么是这样?让我们深入了解容器的工作原理。容器的文件系统当容器运行时,它使用镜......
  • k8s学习手册
    k8s学习手册k8s学习手册原理讲解1、Master和Node1)、MasterK8S中的Master是集群控制节点,负责整个集群的管理和控制在Master上运行着以下关键进程:kube-apise......