Loading repository data…
Loading repository data…
pabpereza / repository
Public repository dedicated to guide the use of multi-stage and distroless dockerfile examples in docker, or other containers technologies, with the objetive to create secured templates for new developments
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This repository contains examples of Dockerfiles using the best practices that docker recommends. This approach allows to build a Docker image with a minimal footprint, by copying only the necessary files from the build stage to the final image and using non-root user to run the application.
For more information about multi stage builds, please refer to the official documentation.
Esta tabla muestra la diferencia de tamaño entre los Dockerfiles sin optimizar (.old) y los Dockerfiles optimizados con multi-stage builds y mejores prácticas.
| Imagen | Dockerfile.old | Dockerfile (Optimizado) | Tiempo de Build |
|---|---|---|---|
| go/simple | 870MB | 2.13MB | 20s |
| go/simple_with_packages | 874MB | 2.14MB | 19s |
| java/distroless | 586MB | 192MB | 24s |
| java/maven | 586MB | 287MB | 35s |
| java/simple | 323MB | 211MB | 7s |
| node/backend | 1.13GB | 63.7MB | 13s |
| node/nextjs | ❌ | 48.6MB | 30s |
| python/flask | 1.44GB | 85.5MB | 38s |
| python/simple | ❌ | 873MB | 1m 7s |
| rust/simple | 1.47GB | 8.34MB | 10s |
🤝 ¿Quieres contribuir? Añade tus propios ejemplos y ayuda a la comunidad a ver el impacto de las buenas prácticas en Docker. ¡La tabla se actualiza automáticamente con cada push!
Los valores se actualizan automáticamente mediante GitHub Actions.
Each example contains a Dockerfile and Dockerfile.old. The .old file contains simple Dockerfile without multi stage builds and the Dockerfile contains the multi stage build version.
To build the image, you can use the following command:
docker build -t <image_name> .
If you want to build the image using the old Dockerfile, you can use the following command:
docker build -t <image_name> -f Dockerfile.old .
To run the image, you can use the following command:
docker run -it <image_name>
If you want to contribute to this repository, please follow these steps: