Skip to content

Instantly share code, notes, and snippets.

@davidkryzaniak
Created December 3, 2016 04:52
Show Gist options
  • Save davidkryzaniak/0f1a6738f4247dd8e1ff4781493f7ac5 to your computer and use it in GitHub Desktop.
Save davidkryzaniak/0f1a6738f4247dd8e1ff4781493f7ac5 to your computer and use it in GitHub Desktop.
Auto-Install Docker on AWS Lightsail
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install -y docker-engine
sudo service docker start
sudo docker pull php:5.6-apache
sudo docker run --name apachephp -d --restart=always -p 80:80 php:5.6-apache
@2ro
Copy link

2ro commented Mar 26, 2017

Is this applicable to the Amazon Linux or Ubuntu OS type?

@icalik
Copy link

icalik commented Apr 23, 2017

No, only Ubuntu OS

@mimibar
Copy link

mimibar commented Apr 9, 2019

Can this script be found somewhere inside the ubuntu instance? Such as in /etc/init.d. Can it be updated after the instance has been created?

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