Skip to content

Instantly share code, notes, and snippets.

@844196
Last active April 15, 2022 08:53
Show Gist options
  • Save 844196/1cd87644ad5f8a74e19c871891c40ba2 to your computer and use it in GitHub Desktop.
Save 844196/1cd87644ad5f8a74e19c871891c40ba2 to your computer and use it in GitHub Desktop.
#cloud-config
write_files:
- path: /etc/sysctl.d/local.conf
owner: root
permission: 0644
content: |
fs.inotify.max_user_watches = 524288
- path: /etc/docker/daemon.json
owner: root
permission: 0644
content: |
{
"experimental": true,
"features": {
"buildkit": true
}
}
apt:
sources:
docker.list:
source: deb [arch=amd64 signed-by=$KEY_FILE] https://download.docker.com/linux/ubuntu $RELEASE stable
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
packages:
- docker-ce
- docker-ce-cli
- containerd.io
- zsh
- make
- git-crypt
- direnv
runcmd:
- curl -fsLS -o /usr/local/bin/docker-compose-v1 https://github.com/docker/compose/releases/download/1.29.2/docker-compose-linux-x86_64
- chmod +x /usr/local/bin/docker-compose-v1
- curl -fsLS -o /usr/libexec/docker/cli-plugins/docker-compose https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-linux-x86_64
- chmod +x /usr/libexec/docker/cli-plugins/docker-compose
- curl -fsLS -o /usr/local/bin/compose-switch https://github.com/docker/compose-switch/releases/download/v1.0.4/docker-compose-linux-amd64
- chmod +x /usr/local/bin/compose-switch
- update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/docker-compose-v1 1
- update-alternatives --install /usr/local/bin/docker-compose docker-compose /usr/local/bin/compose-switch 99
- su -c 'sh -c "$(curl -fsLS git.io/chezmoi)" -- -b ~/.local/bin init --apply 844196' ubuntu
- systemctl daemon-reload
- systemctl restart docker containerd
- sysctl --system
system_info:
default_user:
name: ubuntu
shell: /bin/zsh
groups: [docker]
ssh_authorized_keys:
- $(cat ~/.ssh/id_rsa.pub)
@844196
Copy link
Author

844196 commented Apr 14, 2022

multipass launch --cpus 4 --mem 8G --disk 50G --name docker-vm 20.04 --cloud-init ./cloud-config-x86_64.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment