Docker 5
Docker 5
Docker 5
1
Student Name: Tarush chauhan UID: 22BDO10073
Branch: AIT-CSE-DevOps Section/Group: 22BCD-1(B)
Semester: 5 Date of Performance: 16-09-24
Subject Name: Docker and Kubernetes Subject Code: 22CSH-343
To run a node.js application using Docker and manage the Docker volume.
● Dockerfile:
1. A Dockerfile is a script that contains instructions for building a customized docker
image.
2. Each instruction in a Dockerfile creates a new layer in the image, and the final
image is composed of all the layers stacked on top of each other.
3. Dockerfile uses a simple, easy-to-read syntax that can be created and edited with
any text editor.
4. Once a Dockerfile has been created, it can be used to build an image using the
docker build command.
5. Dockerfiles enable faster and more efficient deployment of applications.
6. Dockerfiles can be used in automation testing to build and run test environments
for different applications and services.
7. We can easily integrate your Dockerfile with continuous integration and
continuous deployment (CI/CD) pipelines.
9. Initialize the folder as a node project using the npm init -y command.
10.Install the http package using the npm install http command.
11.Create the Dockerfile and write the following code in it.
FROM node:slim
WORKDIR /app
COPY --from=builder /app .
CMD ["node","hello.js"]
EXPOSE 8080
12.Build the docker image using the “docker build -t <image_name> .” command
and then run the container using the docker run command.
6. Tag the image using the docker tag command and then push it to docker hub using
the docker push command.
4.Result/Output/Writing Summary:
2.
3.