Building a Dockerfile

Length: 00:08:25

Lesson Summary:

The next step in your CI/CD journey is to learn how to create a Dockerfile. Dockerfiles allow you to create your own Docker images to run applications. This lesson will discuss the basics of Dockerfiles and demonstrate how to dockerize the Train Schedule app.
After completing this lesson, you will have a basic understanding of how to build a Dockerfile that can be used to create a Docker image and run Docker containers.


For more information on Dockerfiles, check out the official Dockerfile reference: https://docs.docker.com/engine/reference/builder/


Here is the Train Schedule application source code that was forked for the demo: https://github.com/linuxacademy/cicd-pipeline-train-schedule-docker


Here are the contents of the Dockerfile that that was created in the demo:

FROM node:carbon
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 8080
CMD ["npm", "start"]


This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More