You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
801 B
28 lines
801 B
#!/bin/bash |
|
### |
|
# @Author: Alvis Zhao |
|
# @Date: 2020-08-17 13:26:13 |
|
# @LastEditTime: 2020-08-17 13:31:35 |
|
# @Description: Docker安装配置脚本 |
|
### |
|
|
|
# 安装docker |
|
sudo apt-get update |
|
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common |
|
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - |
|
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" |
|
sudo apt-get -y update |
|
sudo apt-get -y install docker-ce |
|
|
|
# 用户配置 |
|
sudo usermod -aG docker $USER |
|
|
|
# 加速器 |
|
sudo mkdir -p /etc/docker |
|
sudo tee /etc/docker/daemon.json <<-'EOF' |
|
{ |
|
"registry-mirrors": ["https://3i2eoxxr.mirror.aliyuncs.com"] |
|
} |
|
EOF |
|
sudo systemctl daemon-reload |
|
sudo systemctl restart docker
|
|
|