docker相关配置

简介: 一、概述:  1、centos7下,默认firewalld为防火墙, systemctl status firewalld.service  2、关闭firewalld, systemctl stop firewalld.

一、概述:

  1、centos7下,默认firewalld为防火墙, systemctl status firewalld.service

  2、关闭firewalld, systemctl stop firewalld.service && setenforce 0

  3、安装iptables, yum install iptables-services #安装

    systemctl restart iptables.service #最后重启防火墙使配置生效

    systemctl enable iptables.service #设置防火墙开机启动 

 Docker配置文件:/etc/sysconfig/docker

 主要参数解释:

  1. -H 表示Docker Daemon绑定的地址, -H=unix:///var/run/docker.sock 或者-H=tcp://0.0.0.0:2375
  2. --registry-mirror表示Docker Registry的镜像地址, --registry-mirror=http://xxxx
  3. --insecure-registry表示(本地)私用Docker Registry的地址, --insecure-registry ${privateRegistryHost}:5000
  4. --selinux-enabled是否开始SELinux,默认开启 --selinux-enabled=true; 开启SELinux
  5. --bip表示网桥docker0使用指定的CIDR网络地址, --bip=172.17.42.1
  6. -b 表示采用已经创建好的网桥, -b=xxx

      下面是代理的设置:

  http_proxy=xxxx:8080

  https_proxy=xxxx:8080

  Docker配置文件(Centos 7)

cat /usr/lib/systemd/system/docker.service

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.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 $MAINPID
# 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
Environment="HTTP_PROXY=http://USRNAME:PASSWD@HOST:PORT/"
Environment="HTTPS_PROXY=http://USRENAME:PASSWD@HOST:PORT/"
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# 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

 

 

相关文章
|
2月前
|
关系型数据库 MySQL 开发工具
MySQL5.7主从配置(Docker)
MySQL5.7主从配置(Docker)
732 0
|
3月前
|
NoSQL Redis 数据安全/隐私保护
Docker中Redis的安装与配置
本文主要讲解如何在Docker环境中搭建Redis环境,并进行相关配置
252 5
Docker中Redis的安装与配置
|
1月前
|
前端开发 应用服务中间件 nginx
Nginx配置详解Docker部署Nginx使用Nginx部署vue前端项目
Nginx配置详解Docker部署Nginx使用Nginx部署vue前端项目
112 0
|
3月前
|
Docker 容器
在docker中安装zookeeper,并且阿里云服务器配置
在docker中安装zookeeper,并且阿里云服务器配置
206 1
|
3月前
|
NoSQL Redis Docker
在docker中安装redis,并且阿里云服务器配置
在docker中安装redis,并且阿里云服务器配置
190 1
|
5天前
|
Linux 网络安全 Docker
【Linux】-docker配置容器并打包成镜像
【Linux】-docker配置容器并打包成镜像
|
11天前
|
Ubuntu Linux 测试技术
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试(下)
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试
42 1
|
11天前
|
Ubuntu Linux 测试技术
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试(上)
Linux(32)Rockchip RK3568 Ubuntu22.04上部署 Docker: 详细配置与功能测试
45 0
|
22天前
|
Linux Docker 容器
使用Docker来安装ElasticSearch,并且配置ik分词器
使用Docker来安装ElasticSearch,并且配置ik分词器
32 0
|
24天前
|
网络协议 安全 Linux
1.安装 docker 容器并配置镜像加速器
1.安装 docker 容器并配置镜像加速器
98 11