docker配置私有仓库、打开TCP管理端口
该机器主要用于jenkins在编译打包镜像时使用。需要能push镜像到私有仓库,需要开通tcp管理端口作为docker远程机器。
安装docker
# vi /etc/resolv.conf
nameserver 114.114.114.114
# yum update
# yum install -y yum-utils device-mapper-persistent-data lvm2
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# yum-config-manager --enable docker-ce-edge
# yum install docker-ce
配置私有仓库、打开TCP管理端口
# mkdir /etc/docker/
# vi /etc/docker/daemon.json
{"registry-mirrors": ["http://hub-mirror.c.163.com"],"insecure-registries":["http://docker.vonedao.com"]}
# vi /usr/lib/systemd/system/docker.service
#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
关闭selinux和防火墙
# systemctl stop firewalld.service
# systemctl disable firewalld.service
# setenforce 0
# vi /etc/sysconfig/selinux
启动docker服务
#systemctl start docker
原文地址:https://www.cnblogs.com/zoujiaojiao/p/12625317.html
时间: 2024-10-04 13:36:36