Skip to content

Instantly share code, notes, and snippets.

@ChOkO08
Created March 11, 2022 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChOkO08/e909061e25d5bda95877d3b5e8f084a7 to your computer and use it in GitHub Desktop.
Save ChOkO08/e909061e25d5bda95877d3b5e8f084a7 to your computer and use it in GitHub Desktop.
Docker user-data for Ubuntu
#!/bin/bash
apt update -y
DEBIAN_FRONTEND=noninteractive apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu"
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
apt update -y
DEBIAN_FRONTEND=noninteractive apt install docker-ce -y
curl -L "https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
chmod +x "/usr/local/bin/docker-compose"
service docker start
usermod -a -G docker ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment