Skip to content

Instantly share code, notes, and snippets.

@portlandhodl
Created October 4, 2024 07:19
Show Gist options
  • Save portlandhodl/db580ecf0042258efe141083e4df33f0 to your computer and use it in GitHub Desktop.
Save portlandhodl/db580ecf0042258efe141083e4df33f0 to your computer and use it in GitHub Desktop.
Amazon AWS Linux2 Quick Docker Init and Update Scrupt
#!/bin/bash
# Update the system
sudo yum update -y
# Install Docker
sudo amazon-linux-extras install docker -y
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker ec2-user
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Verify installations
echo "Docker version:"
docker --version
echo "Docker Compose version:"
docker-compose --version
echo "Installation complete. You may need to log out and back in for group changes to take effect."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment