提交 0bce5806 编写于 作者: gengqx's avatar gengqx 提交者: Jiangtao Hu

Update install_docker.sh

上级 260ed36d
#!/usr/bin/env bash #!/usr/bin/env bash
############################################################################### ###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved. # Copyright 2018 The Apollo Authors. All Rights Reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -40,31 +40,25 @@ fi ...@@ -40,31 +40,25 @@ fi
sudo apt-get update sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
} }
function install_docker_x86() { function install_docker_x86() {
sudo add-apt-repository \ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$(lsb_release -cs) \
stable"
sudo apt-get update sudo apt-get update
sudo apt-get install -y docker-ce sudo apt-get install -y docker-ce
sudo groupadd docker sudo groupadd docker
sudo gpasswd -a $USER docker sudo gpasswd -a $USER docker
newgrp docker newgrp docker
} }
function install_docker_arm() { function install_docker_arm() {
sudo bash -c 'echo "deb [arch=arm64] https://download.docker.com/linux/ubuntu xenial edge" > /etc/apt/sources.list.d/docker.list' sudo bash -c 'echo "deb [arch=arm64] https://download.docker.com/linux/ubuntu xenial edge" > /etc/apt/sources.list.d/docker.list'
sudo apt-get update sudo apt-get update
sudo apt-get install -y docker-ce sudo apt-get install -y docker-ce
sudo groupadd docker sudo groupadd docker
sudo gpasswd -a $USER docker sudo gpasswd -a $USER docker
newgrp docker newgrp docker
} }
function install() { function install() {
...@@ -82,7 +76,7 @@ fi ...@@ -82,7 +76,7 @@ fi
} }
case $1 in case $1 in
   install)   install)
install install
;; ;;
uninstall) uninstall)
...@@ -93,7 +87,3 @@ case $1 in ...@@ -93,7 +87,3 @@ case $1 in
install install
;; ;;
esac esac
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册