Skip to content

Instantly share code, notes, and snippets.

Last active December 11, 2019 08:55
What would you like to do?
Bootstrap docker and compose on new machine
# Run like
# $ curl | bash
set -e
setup () {
### Update the apt package index:
sudo apt update
sudo apt upgrade -y
### Install packages to allow apt to use a repository over HTTPS:
sudo apt -y install \
apt-transport-https \
ca-certificates \
curl \
git \
# Install docker
curl -fsSL | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] \
$(lsb_release -cs) \
sudo apt update
sudo apt -y install docker-ce
# Install docker-compose
sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
echo "## Installing docker and docker-compose ##" && setup
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment