Skip to content

Instantly share code, notes, and snippets.

@lamlion
Last active July 7, 2018 00:12
Show Gist options
  • Save lamlion/fe018555d266ed07ab5513762a04f967 to your computer and use it in GitHub Desktop.
Save lamlion/fe018555d266ed07ab5513762a04f967 to your computer and use it in GitHub Desktop.
AWS EC2 simple AMI with docker post commands
#!/bin/bash
yum update -y
yum install docker -y
yum install curl -y
yum install git -y
service docker start
curl -L https://github.com/docker/compose/releases/download/1.22.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo 'export PATH=/usr/local/bin:$PATH' | tee -a /etc/profile –
groupadd docker
usermod -aG docker ec2-user
# if you want to include NextCloud
docker run -d --restart=unless-stopped -p 80:80 --name nextcloud -h nextcloud -v nextcloud:/var/www/html/ nextcloud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment