Last active
May 9, 2022 19:45
-
-
Save sysrex/a8b7fd0e73d2dc994e4a54f1ecec2768 to your computer and use it in GitHub Desktop.
Cloud init script to install docker and docker compose debian 10
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 | |
| groups: | |
| - docker | |
| users: | |
| - default | |
| # the docker service account | |
| - name: docker-service | |
| groups: docker | |
| package_upgrade: true | |
| packages: | |
| - apt-transport-https | |
| - ca-certificates | |
| - curl | |
| - gnupg-agent | |
| - software-properties-common | |
| runcmd: | |
| # install docker following the guide: https://docs.docker.com/install/linux/docker-ce/debian/ | |
| - curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
| - echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ | |
| $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
| - sudo apt-get -y update | |
| - sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin | |
| - sudo systemctl enable docker | |
| power_state: | |
| mode: reboot | |
| message: Restarting after installing docker & docker-compose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment