forked from aqzt/kjyw
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
2 changed files
with
65 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,18 @@ | ||
# 快速Docker安装 | ||
|
||
## 自动yum安装Docker,Docker配置yum源 | ||
## yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
## curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo | ||
## curl -o /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
## daemon.json k8s私有可以增加 "insecure-registries":["harbor.io", "k8s.gcr.io", "gcr.io", "quay.io"], | ||
## 卸载docker命令 yum remove -y docker-ce docker-common-* | ||
|
||
|
||
# 使用方法 | ||
``` | ||
bash install-docker-18.09.8.sh | ||
``` | ||
|
||
``` | ||
curl -s https://gitee.com/aqztcom/kjyw/raw/master/docker/install-docker-18.09.8.sh | bash | ||
``` |
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,47 @@ | ||
#!/bin/bash | ||
## 自动yum安装Docker,Docker配置yum源 2020-05-31 | ||
## 有问题反馈 https://aq2.cn/c/docker | ||
## email: [email protected] | ||
## robert yu | ||
## redhat 7 | ||
|
||
##安装 | ||
## yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
## curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo | ||
## curl -o /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
## daemon.json k8s私有可以增加 "insecure-registries":["harbor.io", "k8s.gcr.io", "gcr.io", "quay.io"], | ||
## 卸载docker命令 yum remove -y docker-ce docker-common-* | ||
|
||
|
||
yum-config-manager --add-repo https://mirrors.aliyun.com/repo/Centos-7.repo | ||
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
yum makecache fast | ||
yum install -y yum-utils device-mapper-persistent-data lvm2 nfs-utils conntrack-tools | ||
yum install -y docker-ce-18.09.8 docker-ce-cli-18.09.8 | ||
|
||
|
||
##配置docker源 | ||
mkdir -p /etc/docker | ||
if [[ -f /etc/docker/daemon.json ]] ; then | ||
/usr/bin/cp /etc/docker/daemon.json /etc/docker/daemon.json.bak.`date "+%Y%m%d%H%M%S"` | ||
fi | ||
echo -e ' | ||
{ | ||
"storage-driver": "overlay2", | ||
"storage-opts": [ "overlay2.override_kernel_check=true" ], | ||
"registry-mirrors": ["https://4ux5p520.mirror.aliyuncs.com"], | ||
"exec-opts": ["native.cgroupdriver=systemd"], | ||
"data-root": "/data/docker", | ||
"log-driver": "json-file", | ||
"log-opts": { | ||
"max-size": "100m" | ||
} | ||
} | ||
' > /etc/docker/daemon.json | ||
|
||
|
||
##启动 | ||
systemctl daemon-reload | ||
systemctl enable docker | ||
systemctl restart docker | ||
docker version |