Dockerfile from OWASP DockSec, an AI-assisted Dockerfile security tool — a real-world example, rewritten upstream on 2026-09-20. It now pins its tool versions and fails loudly on a bad download, but still fetches a binary and an archive with no checksum or signature check, runs as root, and executes a copied-in entrypoint script.
Source: GitHub
FROM python:3.12-slimARG TRIVY_VERSION=0.74.0ARG HADOLINT_VERSION=2.15.1RUN apt-get update && apt-get install -y --no-install-recommends curl git && rm -rf /var/lib/apt/lists/*RUN set -eux; arch="$(dpkg --print-architecture)"; case "$arch" in amd64) hadolint_arch='x86_64' ;; arm64) hadolint_arch='arm64' ;; *) echo "unsupported architecture: $arch" >&2; exit 1 ;; esac; curl -fsSL -o /usr/local/bin/hadolint "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-Linux-${hadolint_arch}"; chmod +x /usr/local/bin/hadolintRUN set -eux; arch="$(dpkg --print-architecture)"; case "$arch" in amd64) trivy_arch='Linux-64bit' ;; arm64) trivy_arch='Linux-ARM64' ;; *) echo "unsupported architecture: $arch" >&2; exit 1 ;; esac; curl -fsSL -o /tmp/trivy.tar.gz "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_${trivy_arch}.tar.gz"; tar -xzf /tmp/trivy.tar.gz -C /usr/local/bin trivy; rm -f /tmp/trivy.tar.gzRUN trivy --version && hadolint --versionWORKDIR /srcCOPY . .RUN pip install --no-cache-dir ".[ai]"RUN docksec --versionWORKDIR /github/workspaceRUN rm -rf /srcCOPY entrypoint.sh /entrypoint.shRUN chmod +x /entrypoint.shENTRYPOINT ["/entrypoint.sh"]RUN set -eux \
; arch="$(dpkg --print-architecture)" \
; case "$arch" in amd64) hadolint_arch='x86_64' \
; arm64) hadolint_arch='arm64' \
; *) echo "unsupported architecture: $arch" >&2 \
; exit 1 \
; esac \
; curl -fsSL -o /usr/local/bin/hadolint "https://github.com/hadolint/hadolint/releases/download/v${HADOLINT_VERSION}/hadolint-Linux-${hadolint_arch}" \
; chmod +x /usr/local/bin/hadolintRUN set -eux \
; arch="$(dpkg --print-architecture)" \
; case "$arch" in amd64) trivy_arch='Linux-64bit' \
; arm64) trivy_arch='Linux-ARM64' \
; *) echo "unsupported architecture: $arch" >&2 \
; exit 1 \
; esac \
; curl -fsSL -o /tmp/trivy.tar.gz "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_${trivy_arch}.tar.gz" \
; tar -xzf /tmp/trivy.tar.gz -C /usr/local/bin trivy \
; rm -f /tmp/trivy.tar.gzFROM python:3.12-slimContainer userRUN apt-get update \
&& apt-get install -y --no-install-recommends curl git \
&& rm -rf /var/lib/apt/lists/*COPY . .FROM python:3.12-slimENTRYPOINT ["/entrypoint.sh"]RUN pip install --no-cache-dir ".[ai]"RUN apt-get update \
&& apt-get install -y --no-install-recommends curl git \
&& rm -rf /var/lib/apt/lists/*No HEALTHCHECK defined