Last active
March 4, 2021 21:04
-
-
Save MeenachiSundaram/0136f84065ffc9133409506d8cb1e8b8 to your computer and use it in GitHub Desktop.
DigitalOcean userdata(startup script) for Docker and Docker Compose Installation
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
#!/bin/bash | |
# Docker | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sh get-docker.sh | |
# Docker Compose | |
compose_release() { | |
curl --silent "https://api.github.com/repos/docker/compose/releases/latest" | | |
grep -Po '"tag_name": "\K.*?(?=")' | |
} | |
if ! [ -x "$(command -v docker-compose)" ]; then | |
curl -L https://github.com/docker/compose/releases/download/$(compose_release)/docker-compose-$(uname -s)-$(uname -m) \ | |
-o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment