Andrew Maxwell

How to setup and install Docker on Google Compute Engine

July 08, 2016
Create a new Google Compute Engine (GCE) instance:
  1. Go to your Google Cloud Platform console
  2. Create a new Google Compute Engine, with Debian 8 or Linux distort of your choice.
    1. Give it a name
    2. Choose a zone
    3. Choose a machine type
    4. Allow HTTP traffic
    5. Click “Create”
  3. SSH into your new Google Compute Engine
Install Docker on your new Google Compute Engine Machine:
  1. Login as super user
    1. sudo -s
  2. Run the following command to install docker
    1. sudo apt-get install docker.io
  3. Docker is now ready!
  4. Test docker
    1. docker ps
Build your docker image on your new Google Compute Engine machine:
  1. Pull your docker image that has been pushed to the cloud, in either a private or public repository
    • docker pull <your username>/<app name>
  2. docker run -p 80:7777 -d <your username>/<app name>
Access your new machine:
Open the following IP in your browser [your new google cloud machine IP]
Install cURL on your machine if it doesn’t have it already:
  1. apt-get update
  2. apt-get install curl
Helpful hint:
  1. Create an image of your new machine so that you can use it later.
  2. Don’t forget to login to Docker on your new GCE if you are trying to access a private image.

Leave a Reply

You must be logged in to post a comment.