Created
October 16, 2025 13:14
-
-
Save cmbaughman/344d270c9345c012f6203cb2db551a9c to your computer and use it in GitHub Desktop.
Cloud Init Script To Install Docker
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 | |
| package_update: true | |
| package_upgrade: true | |
| packages: | |
| - apt-transport-https | |
| - ca-certificates | |
| - curl | |
| - gnupg | |
| - lsb-release | |
| runcmd: | |
| # Add Docker's official GPG key | |
| - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
| # Docker stable | |
| - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
| # Update package index and install Docker | |
| - apt-get update | |
| - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
| # Add current user to the docker group (optional, for non-root access) | |
| - usermod -aG docker ubuntu # Replace 'ubuntu' with your desired username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment