add docker install
This commit is contained in:
parent
85c050dff7
commit
f207a7f2b5
23
init_priv.sh
23
init_priv.sh
@ -108,6 +108,28 @@ configure_tmux() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configure_docker() {
|
||||||
|
if confirm_action "要安装 docker 吗?" "N"; then
|
||||||
|
# 卸载旧版本
|
||||||
|
sudo apt remove docker docker-engine docker.io
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y
|
||||||
|
# 添加软件源的 GPG 密钥,并向 sources.list 中添加 Docker 软件源
|
||||||
|
if [ $abroad -eq 1 ]; then
|
||||||
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||||
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
else
|
||||||
|
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||||
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
fi
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
|
||||||
|
sudo systemctl enable docker
|
||||||
|
sudo systemctl start docker
|
||||||
|
sudo pip3 install docker-compose
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
configure_fail2ban() {
|
configure_fail2ban() {
|
||||||
[ -f /etc/fail2ban/jail.local ] && return
|
[ -f /etc/fail2ban/jail.local ] && return
|
||||||
|
|
||||||
@ -155,6 +177,7 @@ configure_nano
|
|||||||
configure_vim
|
configure_vim
|
||||||
configure_zsh
|
configure_zsh
|
||||||
configure_tmux
|
configure_tmux
|
||||||
|
configure_docker
|
||||||
configure_fail2ban
|
configure_fail2ban
|
||||||
configure_iptables
|
configure_iptables
|
||||||
configure_hostname
|
configure_hostname
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user