1. Antipatrones clásicos en un Dockerfile de Ubuntu
Desarrollador backendContexto
El equipo heredó un Dockerfile con ubuntu:latest, MAINTAINER, apt-get sin limpieza, sudo, ADD, COPY . ., un secreto en ENV, EXPOSE 70000, CMD en forma shell y USER root.
Problema
Ver de un vistazo errores, avisos e info con línea, motivo y ejemplo de corrección.
Cómo usarlo
Pega el Dockerfile, deja «Severidad mínima» en Todo (info y superiores) y activa Incluir regla HEALTHCHECK.
FROM ubuntu:latest
MAINTAINER [email protected]
RUN apt-get update && apt-get install -y curl wget
RUN cd /app && sudo cp x y
ADD app.py /app/app.py
COPY . .
ENV PASSWORD=secret123
EXPOSE 70000
CMD npm start
USER rootResultado
16 hallazgos: 4 errores (DL4000, DL3004, DL3020, DL3011), 8 avisos y 4 info, con vista del código anotada línea a línea.