Skip to content

Instantly share code, notes, and snippets.

@yashrastogi16
Last active December 30, 2016 10:35
Show Gist options
  • Select an option

  • Save yashrastogi16/7d12eba538636d28d8c8b754eee7584b to your computer and use it in GitHub Desktop.

Select an option

Save yashrastogi16/7d12eba538636d28d8c8b754eee7584b to your computer and use it in GitHub Desktop.
# Log in to the ubuntu server by any means
sudo ssh -i [pemfile location] ubuntu@[ip]
-> Make a note ou ubuntu version in which you are logged in. For this its 16.04
# Update ubuntu
sudo apt-get update
# Install python and python-pip
sudo apt-get install python && python-pip
# # Refer: https://docs.docker.com/engine/installation/linux/ubuntulinux/
# Install Docker
sudo apt-get install 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
-> Verfy correct repo of docker.
apt-cache policy docker-engine
-> Update Package manager
sudo apt-get update
-> Install the recommended packages.
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
-> Reboot your host to use the updated kernel.
sudo reboot
-> Install docker
sudo apt-get install docker-engine
-> Start the docker daemon
sudo service docker start
-> Verify that docker is installed correctly by running the hello-world image.
sudo docker run hello-world
## Refer: https://docs.docker.com/compose/install/
# Install docker-compose
pip install docker-compose
# Git clone the code if git is installed, if not install it and clone.
# Git installation
sudo apt-get install git
# GIt clone
git clone [repo link]
# Go inside the project directory and start executing docker comand to build image and container.
cd [project folder]
# Docker build and run
docker-compose up
# Docker build and run deamonize
docker-compose up -d
# Docker stop
docker-compose down -v
# For someuseful commands go to link.
https://gist.github.com/yashrastogi16/ad00cc0033e4e48f6936a07e5afd418f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment