Last active
March 10, 2024 16:28
-
-
Save jeffbrl/3ac3b29c42cd0f750b7015a245528a24 to your computer and use it in GitHub Desktop.
Cloud-init for Debian Docker Host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
# Adapted from Mathew Dugan's article at https://matduggan.com/idiot-proof-infrastructure/ | |
package_update: true | |
package_upgrade: true | |
package_reboot_if_required: true | |
groups: | |
- docker | |
users: | |
- name: debian | |
lock_passwd: true | |
shell: /bin/bash | |
ssh_authorized_keys: | |
- ${PUT_SSH_PUBLIC_KEY_HERE} | |
groups: docker | |
sudo: ALL=(ALL) NOPASSWD:ALL | |
packages: | |
- apt-transport-https | |
- ca-certificates | |
- curl | |
- gnupg-agent | |
- software-properties-common | |
- unattended-upgrades | |
runcmd: | |
- curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - | |
- add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian $(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/v2.24.7/docker-compose-linux-$(uname -m)" -o /usr/local/bin/docker-compose | |
- chmod +x /usr/local/bin/docker-compose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment