1FROM python:3.11-slim
2WORKDIR /srv
3ARG DB_PASSWORD
4ENV DB_PASSWORD=$DB_PASSWORD
5COPY . .
6RUN pip install -r requirements.txt
7RUN echo "Booting with DB_PASSWORD=$DB_PASSWORD" >> /srv/build.log
8CMD ["python", "app.py"]
no lines flagged
#119PracticeMedium15 min · 120 XP
Build Secret Baked Into the Image Layers
A database password rotates weekly, yet a leaked container image from months ago still yields working credentials.
Flagged linesNo lines flagged yet
Flag a line or write a note to submit.