-
-
Save L-U-C-K-Y/a1eb9c2a0aa55a9c64e1002ee0bff97f to your computer and use it in GitHub Desktop.
cloud init / cloud config to install Docker on Ubuntu
This file contains 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 | |
# Option 1 - Full installation using cURL | |
package_update: true | |
package_upgrade: true | |
groups: | |
- docker | |
system_info: | |
default_user: | |
groups: [ docker ] | |
packages: | |
- apt-transport-https | |
- ca-certificates | |
- curl | |
- gnupg | |
- lsb-release | |
- unattended-upgrades | |
runcmd: | |
- mkdir -p /etc/apt/keyrings | |
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null | |
- apt-get update | |
- apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin | |
- systemctl enable docker | |
- systemctl start docker | |
final_message: "The system is finally up, after $UPTIME seconds" |
This file contains 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 | |
# Option 2: Simplified, using the default package | |
package_update: true | |
package_upgrade: true | |
groups: | |
- docker | |
system_info: | |
default_user: | |
groups: [docker] | |
packages: | |
- docker.io | |
- unattended-upgrades | |
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