Skip to content

Instantly share code, notes, and snippets.

@myugan
Last active March 14, 2021 02:16
Show Gist options
  • Save myugan/5fd84fc1b2d5c3ebf01532d18b7960ab to your computer and use it in GitHub Desktop.
Save myugan/5fd84fc1b2d5c3ebf01532d18b7960ab to your computer and use it in GitHub Desktop.
Setup Docker and Compose on Ubuntu 18.04 machine
#!/bin/bash
# Install dependency
apt install -y apt-transport-https ca-certificates curl software-properties-common
# Add GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add docker repository to APT sources
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" -y
# Install docker community edition
apt update
apt install -y docker-ce
# Download docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment