-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhichunqi
committed
Jul 31, 2019
1 parent
8b6c09c
commit 039a797
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
#添加docker启动配置daemon.json文件 | ||
cat > /etc/docker/daemon.json <<EOF | ||
{ | ||
"icc":false, | ||
"ip-forward":false | ||
} | ||
EOF | ||
|
||
#重新加载配置文件 | ||
systemctl daemon-reload | ||
|
||
#重启docker服务 | ||
systemctl restart docker.service | ||
|
||
#禁止宿主机IP转发功能 | ||
cat >> /etc/sysctl.conf <<EOF | ||
net.ipv4.ip_forward=0 | ||
EOF | ||
|
||
#重新加载配置文件 | ||
sysctl -p /etc/sysctl.conf |