Skip to content

Instantly share code, notes, and snippets.

@offlinehacker
Created March 2, 2022 11:52
Show Gist options
  • Save offlinehacker/7d6485c9e748638d886d60ca91775bf6 to your computer and use it in GitHub Desktop.
Save offlinehacker/7d6485c9e748638d886d60ca91775bf6 to your computer and use it in GitHub Desktop.
Multipass cloud config to create VM with docker installed
#cloud-config
groups:
- docker
users:
- name: ubuntu
sudo: ALL=(ALL) NOPASSWD:ALL
groups: users,docker,admin
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDwB83EYt+55hfu6SzIFKrZ7E8Vli2NaZ5E1vgieFslSGJfJGECfrK8m26/5US/W+Rjfgi9VR0L1zY92eld92134mQQFiPeGWpU88iUVykNmm6B8iA6I/AlzPa+qeZaH5iteWvUxqApZ1s0nFnIVA9PI9+OSzEX/nDrWEiNMxc2H1L0GIf/OAzCEs8WllVSHSqA35wuXQBkPDF6d+SMtRe6tZ82BT5InSFmWVP+TBREV2/okrgEJSF9exD8myXKuPqe4pCZqVgiHMi1NpGs/sDack/yuOHVT+eMKVE23j4r5zhvkMS4Y4oEpj4v0V8DChZSniMvhvp9qxKMJJKwKDWn
package_update: true
packages:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
- socat
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
- curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
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