Skip to content

Instantly share code, notes, and snippets.

@satishbabariya
Last active March 24, 2022 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satishbabariya/65756c5ed00875ab59c0c92f0c6e0be6 to your computer and use it in GitHub Desktop.
Save satishbabariya/65756c5ed00875ab59c0c92f0c6e0be6 to your computer and use it in GitHub Desktop.
Docker & Docker Compose Install Script
# Docker & Docker Compose will need to be installed on the machine
# curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
# sh /tmp/get-docker.sh
# curl -L "https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# chmod 755 /usr/local/bin/docker-compose
# sudo systemctl enable docker
# sudo usermod -aG docker $USER
# sudo chmod 666 /var/run/docker.sock
sudo amazon-linux-extras install docker -y
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chkconfig docker on
sudo yum install -y git
sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod 755 /usr/local/bin/docker-compose
@satishbabariya
Copy link
Author

sudo curl -sfL https://gist.githubusercontent.com/satishbabariya/65756c5ed00875ab59c0c92f0c6e0be6/raw/df9e20420a9a05c7153db83a7313e4b2f360b82f/install-docker.sh | sh

@satishbabariya
Copy link
Author

sudo curl -sfL https://bit.ly/33YCpe4  | sh

@satishbabariya
Copy link
Author

Amazon changed the install in Linux 2. One no-longer using 'yum'
See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user

Make docker auto-start

sudo chkconfig docker on

Because you always need it....

sudo yum install -y git

Reboot to verify it all loads fine on its own.

sudo reboot

@satishbabariya
Copy link
Author

sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chkconfig docker on
sudo yum install -y git
curl -L "https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod 755 /usr/local/bin/docker-compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment