Last active
August 27, 2019 08:01
-
-
Save curder/530f2962208c96a36c5af97789c81c09 to your computer and use it in GitHub Desktop.
Revisions
-
curder revised this gist
Aug 27, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ EOF ``` sudo groupadd docker sudo usermod -aG docker $USER sudo systemctl enable docker sudo systemctl start docker ``` -
curder revised this gist
Aug 23, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -30,6 +30,8 @@ sh get-docker.sh --mirror Aliyun ## 更改 docker 源 ``` sudo mkdir -p /etc/docker/ sudo cat > /etc/docker/daemon.json << EOF { "registry-mirrors": [ @@ -39,6 +41,7 @@ sudo cat > /etc/docker/daemon.json << EOF } EOF ``` > 如果提示没有权限,需要先切换到 root 身份,并通过 `cat /etc/docker/daemon.json` 查看配置是否写入文件。 ## 配置并启动 docker -
curder revised this gist
Aug 23, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ ## 关闭 SELinux ``` sudo setenforce 0 sudo cp /etc/sysconfig/selinux /etc/sysconfig/selinux.bak`date +%F` && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux ``` ## 替换镜像源 -
curder renamed this gist
Aug 23, 2019 . 1 changed file with 9 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ sudo cat > /etc/docker/daemon.json << EOF EOF ``` ## 配置并启动 docker ``` sudo groupadd docker @@ -49,4 +49,11 @@ sudo systemctl enable docker sudo systemctl start docker ``` > 将上面的 `<user>` 替换成操作的用户。 ## docker-compose 安装和配置 ``` curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose ``` -
curder renamed this gist
Aug 23, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
curder created this gist
Aug 23, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ ## 关闭 SELinux ``` setenforce 0 cp /etc/sysconfig/selinux /etc/sysconfig/selinux.bak`date +%F` && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux ``` ## 替换镜像源 ``` sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo sudo yum makecache ``` ## 下载常用工具 ``` sudo yum install -y git vim gcc glibc-static telnet bridge-utils wget net-tools tree ``` ## 安装 docker ``` curl -fsSL get.docker.com -o get-docker.sh sh get-docker.sh --mirror Aliyun ``` ## 更改 docker 源 ``` sudo cat > /etc/docker/daemon.json << EOF { "registry-mirrors": [ "https://dockerhub.azk8s.cn", "https://reg-mirror.qiniu.com" ] } EOF ``` ## 更改 ``` sudo groupadd docker sudo usermod -aG docker <user> sudo systemctl enable docker sudo systemctl start docker ``` > 将上面的 `<user>` 替换成操作的用户。