Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon

Dockerizing an App

Docker is a great tool for running and orchestrating software. However, to effectively use Docker, you will first need to know how to run an app using Docker. In this hands-on lab, you will learn how to dockerize an app by creating a Docker image for an application and running the image as a Docker container. After completing this exercise, you will gain basic knowledge to configure an existing application to use Docker.

Google Cloud Platform icon

Path Info

Clock icon Intermediate
Clock icon 45m
Clock icon Jul 08, 2018

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create a Dockerfile for the Application

    1. Create a Dockerfile.
    2. Fork the source code repository on GitHub:
    3. If you want to clone the repo elsewhere and create the Dockerfile yourself, just be sure to commit and push it to your fork.
    4. If you would like to create the file in GitHub itself, then use the Add file then Create new file button when viewing the GitHub repo.
    • Here is a sample Dockerfile:
      FROM node:carbon
      WORKDIR /usr/src/app
      COPY package*.json ./
      RUN npm install
      COPY . .
      EXPOSE 8080
      CMD [ "npm", "start" ]
    1. Once you have a docker file, log in to the learning activity environment and clone your fork inside the cloud_user home directory.
  2. Challenge

    Build a Docker Image Using the Dockerfile and Run It

    1. Get into your source code directory.
    2. Build a docker image using your Dockerfile.
    3. Run the app in a container using the image. Be sure to use port 8080.
    4. Once the container is running, you should be able to access the train schediule app in a browser: http://<your learning activity environment public IP>:8080

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans