Created
June 2, 2023 20:09
-
-
Save olegon/2f243404b2d917281cb11143cc31c5a6 to your computer and use it in GitHub Desktop.
Userdata script for AWS Linux that installs docker and docker-compose.
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
#!/usr/bin/env bash | |
set -e | |
# updating system | |
yum update -y | |
# installing docker | |
yum install docker -y | |
# installing docker-compose | |
wget https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) | |
mv docker-compose-$(uname -s)-$(uname -m) /usr/local/bin/docker-compose | |
chmod -v +x /usr/local/bin/docker-compose | |
# activating docker | |
systemctl enable docker.service | |
systemctl start docker.service | |
# adding ec2-user to docker group | |
usermod -a -G docker ec2-user | |
newgrp docker # realoding group |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment