Junior — Middle
What is the role of the Alpine image in creating Docker containers?
sobes.tech AI
Answer from AI
Alpine is a minimalist Linux distribution that is often used as a base image for Docker containers. Its role is to provide a lightweight and secure foundation for containers with minimal size, which speeds up loading and reduces resource consumption.
Advantages of the Alpine image:
- Very small size (about 5 MB), which reduces the size of the final container.
- Minimal number of pre-installed packages, which reduces the attack surface.
- Fast loading and deployment of containers.
Example of using Alpine in a Dockerfile:
FROM alpine:latest
RUN apk add --no-cache curl
CMD ["curl", "https://example.com"]