2021-01-27 22:07:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# abort this script on errors
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
setup_docker() (
|
|
|
|
# steps from https://docs.docker.com/engine/install/ubuntu/
|
|
|
|
sudo apt-get install -y \
|
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg-agent \
|
2021-04-27 17:57:42 +00:00
|
|
|
software-properties-common \
|
|
|
|
;
|
2021-01-27 22:07:57 +00:00
|
|
|
|
|
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg |
|
|
|
|
sudo apt-key add -
|
|
|
|
|
|
|
|
local repo
|
|
|
|
repo=$(
|
|
|
|
printf "deb [arch=amd64] https://download.docker.com/linux/ubuntu %s stable" \
|
|
|
|
"$(lsb_release -cs)"
|
|
|
|
)
|
|
|
|
sudo add-apt-repository "$repo"
|
|
|
|
|
|
|
|
sudo apt-get update
|
2021-04-27 17:57:42 +00:00
|
|
|
sudo apt-get install -y \
|
|
|
|
containerd.io \
|
|
|
|
docker-ce \
|
|
|
|
docker-ce-cli \
|
|
|
|
;
|
2021-01-27 22:07:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
setup_docker_compose() (
|
|
|
|
# from https://docs.docker.com/compose/install/
|
|
|
|
sudo curl -L \
|
|
|
|
"https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" \
|
|
|
|
-o /usr/local/bin/docker-compose
|
|
|
|
|
|
|
|
sudo chmod +x /usr/local/bin/docker-compose
|
|
|
|
)
|
|
|
|
|
|
|
|
main() (
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
sudo apt-get update
|
|
|
|
setup_docker
|
|
|
|
setup_docker_compose
|
|
|
|
sudo apt-get install -y jq
|
|
|
|
sudo usermod -aG docker vagrant
|
|
|
|
)
|
|
|
|
|
|
|
|
main
|