docker18.09 快速添加harbor仓库地址的方法(不是安装harbor)和修改镜像容器存放位置(初始化安装docker时,不是迁移容器镜像)...
2023-09-27 14:25:55 时间
系统版本:centos7.6
系统内核: 4.4
docker版本:18.09
找到docker.server启动文件位置,打开后,修改
[root@243-ceshi ~]# vim /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
#BindsTo=containerd.service. — 无需containerd。
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 -H unix:// --graph /app/software --insecure-registry=hub.vrgv.com
ExecReload=/bin/kill -s HUP $MAINPID
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 supports 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
[Install]
WantedBy=multi-user.target
--graph:指定容器镜像存放位置
--insecure-registry:指定harbor仓库地址
另一种方法是配置/etc/docker/dameon.json文件,也可以的
[root@243-ceshi ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://v16stybc.mirror.aliyuncs.com"],"registry-mirrors": ["https://hub.vrgv.com"], "exec-opts": ["native.cgroupdriver=systemd"]
}
相关文章
- 如何使用Elasticsearch和cAdvisor监控Docker容器
- docker-compose up -d 运行报错: ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.17/community: temporary erro
- Docker、Kubernetes与PaaS不得不说的渊源
- Docker-compose ports和expose的区别
- Docker介绍、常用命令、项目部署
- Docker学习笔记之Docker 的简历
- 【Docker】Dockerfile 之 SHELL
- 【Docker】命令 diff
- Helm 架构 - 每天5分钟玩转 Docker 容器技术(161)
- replicated mode vs global mode - 每天5分钟玩转 Docker 容器技术(105)
- 万能日志数据收集器 Fluentd - 每天5分钟玩转 Docker 容器技术(91)
- 如何部署 Calico 网络?- 每天5分钟玩转 Docker 容器技术(67)
- CentOS7.4下使用docker运行mongodb,对原有mongodb备份及迁移
- docker in all
- docker:docker prune命令 可定时清理不常用数据
- Docker Swarm 进阶:集群容错
- docker 部署
- Docker镜像相关-查看镜像信息
- Docker 安全:通过 Docker 提升权限
- 如何使用 Anchore 安全扫描 Docker 镜像
- Docker 入门教程