Sobes.tech
Junior — Middle

Can you list the main types of images used in Docker?

sobes.tech AI

Answer from AI

Main types of images in Docker:

  • Official Images — supported by Docker and the community, e.g., python, nginx.
  • Custom Images — created by developers for specific tasks.
  • Base Images — minimal images containing only the OS or a minimal set of packages, e.g., alpine, ubuntu.
  • Multi-stage Images — used to optimize the size of the final image by separating the build process and the final image.

Example of creating a custom image based on a base image:

FROM python:3.9-slim
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
CMD ["python", "app.py"]