图片代码如何做网站,打开网站后直接做跳转页面,制作app页面的软件,云核wordpress文章目录 前言一、下载文件二、解压配置 systemd 启动#xff08;Configure the daemon with systemd#xff09;docker.servicedaemon.json 启动总结 前言
使用二进制包方式安装docker 。 一、下载文件
下载地址#xff1a;
https://download.docker.com/linux/static/s… 文章目录 前言一、下载文件二、解压配置 systemd 启动Configure the daemon with systemddocker.servicedaemon.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]
DescriptionDocker Application Container Engine
Documentationhttps://docs.docker.com
Afternetwork-online.target docker.socket firewalld.service containerd.service time-set.target
Wantsnetwork-online.target containerd.service
# Requiresdocker.socket 可以不使用[Service]
Typenotify
# 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
TimeoutStartSec0
RestartSec2
Restartalways# 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.
StartLimitBurst3# 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.
StartLimitInterval60s# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILEinfinity
LimitNPROCinfinity
LimitCOREinfinity# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
# TasksMaxinfinity# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegateyes# kill only the docker process, not all processes in the cgroup
# KillModeprocess
# OOMScoreAdjust-500[Install]
WantedBymulti-user.targetdaemon.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