Skip to content

Instantly share code, notes, and snippets.

@braidn
Created June 23, 2021 02:25
Show Gist options
  • Save braidn/c48bc0aaaa3c680bd0ec9eee25d39e44 to your computer and use it in GitHub Desktop.
Save braidn/c48bc0aaaa3c680bd0ec9eee25d39e44 to your computer and use it in GitHub Desktop.
Cloud init for setting up Docker
#cloud-config
groups:
- docker
users:
- default
- name: dockeradm
sudo: ALL=(ALL) NOPASSWD:ALL
groups: users, docker
ssh_authorized_keys:
- ssh-rsa yourPublicSSHKey
package_update: true
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
runcmd:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
- add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- apt-get update -y
- apt-get install -y docker-ce docker-ce-cli containerd.io
- systemctl start docker
- systemctl enable docker
final_message: "The system is finally up, after $UPTIME seconds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment