0

【DOCKER】docker简便部署

 1 year ago
source link: https://blog.51cto.com/kangfs/5376814
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

【DOCKER】docker简便部署

原创

DonotCTR 2022-06-12 22:15:34 博主文章分类:k8s ©著作权

文章标签 docker linux 文章分类 Linux 系统/运维 阅读数233

1、服务器基础环境配置

# systemctl stop firewalld && systemctl disable firewalld
# yum install iptables-services vim net-tools yum-utils -y
# service iptables stop
# systemctl disable iptables
# iptables -F
# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# yum install -y ntp ntpdate
# ntpdate cn.pool.ntp.org
# crontab -e
MAILTO=""
0 */1 * * * /usr/sbin/ntpdate cn.pool.ntp.org

# systemctl restart crond

2、docker基础包

# yum install -y wget net-tools nfs-utils lrzsz gcc gcc-c++ make cmake libxml2-devel openssl-devel curl curl-devel unzip sudo ntp libaio-devel wget vim ncurses-devel autoconf automake zlib-devel python-devel epel-release openssh-server
# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# yum install -y yum-utils device-mapper-persistent-data lvm2

3、docker部署

# yum install docker-ce -y
# systemctl start docker && systemctl enable docker
# systemctl status docker

4、修改内核

内核参数修改:br_netfilter模块用于将桥接流量转发至iptables链,br_netfilter内核参数需要开启转发

# cat > /etc/sysctl.d/docker.conf <<EOF
> net.bridge.bridge-nf-call-ip6tables = 1
> net.bridge.bridge-nf-call-iptables = 1
> net.ipv4.ip_forward = 1
> EOF
# sysctl -p /etc/sysctl.d/docker.conf

5、配置docker国内镜像源

# vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://2w4qjr9k.mirror.aliyuncs.com"]
}
# systemctl daemon-reload
# systemctl restart docker
  • 打赏
  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK