Last active
October 2, 2024 15:00
-
-
Save kandrejevs/73f5ce5eeec2d1092198fe9040d816a3 to your computer and use it in GitHub Desktop.
amazon lightsail startup script to install docker and docker compose and dependencies
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
| # Create swap file | |
| sudo fallocate -l 1G /swapfile | |
| sudo chmod 600 /swapfile | |
| sudo mkswap /swapfile | |
| sudo swapon /swapfile | |
| echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
| # Install dependencies | |
| apt install -y git curl | |
| curl -fsSL https://get.docker.com -o get-docker.sh | |
| sh get-docker.sh | |
| 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 | |
| # Configure docker to run without root | |
| groupadd docker | |
| usermod -aG docker ubuntu | |
| eval "$(ssh-agent -s)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment