Last active
June 5, 2020 18:05
-
-
Save sw360cab/2cea97953944f7bf563fd7abedecff59 to your computer and use it in GitHub Desktop.
Simply add Docker in a AWS AMI Linux
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
#!/bin/sh | |
# installing Docker CE on AWS AMI Linux | |
# Run remotely with -> source <(curl -s http://<remote-address-of-this-script>.sh) | |
set -e | |
# Run as su | |
if [ `id -u` -ne 0 ] | |
then | |
echo "You need to be root to run this script" | |
exit 1 | |
fi | |
yum update -y | |
amazon-linux-extras install -y docker | |
usermod -aG docker ec2-user | |
unset DOCKER_HOST | |
service docker restart > /dev/null 2>&1 || true | |
# install Docker Compose | |
read -r -p "Do Yo want to install Docker Compose? [y/N] " response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
# install compose | |
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
;; | |
*) | |
echo "" | |
;; | |
esac | |
echo "Logout/Login from session may be required" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment