Cloud Computing Docker Subjective
Sep 30, 2025

What is a Dockerfile and explain its key instructions?

Detailed Explanation
Dockerfile is a text file containing instructions to build Docker images. Key instructions: 1) FROM: Sets base image, 2) RUN: Executes commands during build, 3) COPY/ADD: Copies files from host to image, 4) WORKDIR: Sets working directory, 5) EXPOSE: Documents ports the container listens on, 6) ENV: Sets environment variables, 7) CMD: Default command when container starts, 8) ENTRYPOINT: Configures container as executable. Example: FROM node:14, WORKDIR /app, COPY package.json ., RUN npm install, COPY . ., EXPOSE 3000, CMD ["npm", "start"].
Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback