Intern — Junior
How well do you understand the concepts and usage of Docker?
sobes.tech AI
Answer from AI
Docker is a platform for building, shipping, and running applications in isolated containers. Containers allow you to package an application with all its dependencies, ensuring consistent operation across different environments.
Key concepts of Docker:
- Images — templates for creating containers, containing the application and its environment.
- Containers — running instances of images.
- Dockerfile — a file with instructions for building an image.
Example of a simple Dockerfile for a Node.js application:
FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["node", "index.js"]
Using Docker helps simplify deployment, scaling, and provides application isolation.