Examples

Real Dockerfiles, hardened by the engine.

Each Dockerfile below comes from a public open-source project. Each result is the engine's output with default settings and no deployment context.

About these examples.

Each Dockerfile is copied unmodified from a public open-source repository at a pinned commit. For each one you see the original, the engine's output as a diff, the findings and the generated .dockerignore.

The engine flags base images that are not pinned to a digest, but it does not pin them. Dockerfiles submitted to Rivex are never added to this page.

Black (Python, multi-stage).

Copyright (c) 2018 Łukasz Langa. Black license (MIT). Original file: Dockerfile at commit 48fe7c0686ef. The hardened Dockerfile below is a modified version produced by Rivex.

Original Dockerfile (28 lines)
FROM python:3.15-slim AS builder

ENV VIRTUAL_ENV=/opt/venv
ENV HATCH_BUILD_HOOKS_ENABLE=1
ENV PIP_NO_CACHE_DIR=1

# Install build tools to compile black + dependencies
RUN apt update && apt install -y build-essential git

WORKDIR /src
COPY . .
RUN python -m venv --without-pip $VIRTUAL_ENV

RUN export PIP_UPLOADED_PRIOR_TO=P2D \
    && pip install --upgrade pip \
    && pip install --group hatch \
    && hatch build -t wheel

ENV PIP_PYTHON=$VIRTUAL_ENV/bin/python
RUN pip install dist/*-cp* "black[colorama,d,uvloop]"

FROM python:3.15-slim

# copy only Python packages to limit the image size
COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

CMD ["/opt/venv/bin/black"]

Hardened diff.

11 FROM python:3.15-slim AS builder22 33 ENV VIRTUAL_ENV=/opt/venv44 ENV HATCH_BUILD_HOOKS_ENABLE=155 ENV PIP_NO_CACHE_DIR=166 77 # Install build tools to compile black + dependencies8-RUN apt update && apt install -y build-essential git8+RUN apt update && apt install -y build-essential git && rm -rf /var/lib/apt/lists/*99 1010 WORKDIR /src1111 COPY . .1212 RUN python -m venv --without-pip $VIRTUAL_ENV1313 1414 RUN export PIP_UPLOADED_PRIOR_TO=P2D \1515     && pip install --upgrade pip \1616     && pip install --group hatch \1717     && hatch build -t wheel1818 1919 ENV PIP_PYTHON=$VIRTUAL_ENV/bin/python2020 RUN pip install dist/*-cp* "black[colorama,d,uvloop]"2121 2222 FROM python:3.15-slim2323 2424 # copy only Python packages to limit the image size2525 COPY --from=builder /opt/venv /opt/venv2626 ENV PATH="/opt/venv/bin:$PATH"2727 2828 CMD ["/opt/venv/bin/black"]29+RUN (getent group 10001 >/dev/null 2>&1 || groupadd -r -g 10001 nonroot 2>/dev/null || addgroup -S -g 10001 nonroot) && (getent passwd 10001 >/dev/null 2>&1 || useradd -r -u 10001 -g 10001 -s /sbin/nologin nonroot 2>/dev/null || adduser -S -D -H -u 10001 -G nonroot nonroot) || (echo "rivex: could not create user nonroot with UID and GID 10001; set USER to the UID:GID of an existing non-root user" >&2 && exit 1)30+USER 10001:10001

Findings.

  • Missing: No USER instruction in the final stage (critical): No USER instruction in final stage; created user nonroot with UID 10001 and GID 10001 and set USER 10001:10001
  • Line 1 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 22 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 8 (medium): Package install without cache cleanup; appended cleanup to RUN
  • Missing: No HEALTHCHECK in the final stage (low): Final stage has no HEALTHCHECK instruction
  • Line 8 (low): RUN performs package-manager install; for reproducibility pin versions and cache package lists with RUN --mount=type=cache (e.g. target=/var/cache/apt,sharing=locked) and clean lists in the same layer
  • Lines 14–17 (low): RUN performs package-manager install; for reproducibility pin versions and cache package lists with RUN --mount=type=cache (e.g. target=/var/cache/apt,sharing=locked) and clean lists in the same layer
  • Line 20 (low): RUN performs package-manager install; for reproducibility pin versions and cache package lists with RUN --mount=type=cache (e.g. target=/var/cache/apt,sharing=locked) and clean lists in the same layer
  • Missing: No # syntax= directive on the first line (medium): Dockerfile lacks BuildKit frontend pinning directive; add '# syntax=docker/dockerfile:1' as the first line for reproducible builds
  • Line 8 (low): unpinned package install detected (apt-get); pin to exact versions for reproducible builds
  • Lines 14–17 (low): unpinned package install detected (pip); pin to exact versions for reproducible builds
  • Line 20 (low): unpinned package install detected (pip); pin to exact versions for reproducible builds
  • Line 11 (medium): COPY/ADD copies entire build context; list specific files or directories to reduce image size and avoid leaking sensitive files
  • Line 8 (low): apt install runs without --no-install-recommends; add the flag to skip recommended packages and reduce image size and attack surface
  • Missing: No org.opencontainers.image.* LABEL in the final stage (low): No OCI image annotation labels found in the final stage; add LABEL org.opencontainers.image.source, .revision, and .version to enable image traceability
  • Lines 14–17 (low): pip install without --no-cache-dir; add flag or set PIP_NO_CACHE_DIR to avoid caching downloaded packages in the image
  • Line 20 (low): pip install without --no-cache-dir; add flag or set PIP_NO_CACHE_DIR to avoid caching downloaded packages in the image
  • Lines 14–17 (medium): Package manager invocation installs named packages from the public registry without a registry override — risk of dependency confusion attack
  • Line 20 (medium): Package manager invocation installs named packages from the public registry without a registry override — risk of dependency confusion attack

Generated .dockerignore.

.git/
.env
.env.*
*.pem
*.key
*.p12
*.pfx
id_rsa
id_dsa
*.der
.ssh/
.DS_Store
*.log
__pycache__/
*.pyc
.pytest_cache/

Full Stack FastAPI Template (Python).

Copyright (c) 2019 Sebastián Ramírez. Full Stack FastAPI Template license (MIT). Original file: backend/Dockerfile at commit e80d92452ec2. The hardened Dockerfile below is a modified version produced by Rivex.

Original Dockerfile (65 lines)
FROM oven/bun:1 AS frontend-build

WORKDIR /app

COPY package.json bun.lock /app/
COPY frontend/package.json /app/frontend/

WORKDIR /app/frontend

RUN bun install

COPY ./frontend /app/frontend

ARG VITE_API_URL=

RUN bun run build


FROM python:3.14

ENV PYTHONUNBUFFERED=1

# Install uv
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/

# Compile bytecode
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
ENV UV_COMPILE_BYTECODE=1

# uv Cache
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#caching
ENV UV_LINK_MODE=copy

WORKDIR /app/

# Place executables in the environment at the front of the path
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
ENV PATH="/app/.venv/bin:$PATH"

# Install dependencies
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
RUN --mount=type=cache,target=/root/.cache/uv \
    --mount=type=bind,source=uv.lock,target=uv.lock \
    --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
    uv sync --frozen --no-install-workspace --package app

COPY ./backend/scripts /app/backend/scripts

COPY ./backend/pyproject.toml ./backend/alembic.ini /app/backend/

COPY ./backend/app /app/backend/app

COPY --from=frontend-build /app/backend/app/frontend /app/backend/app/frontend

# Sync the project
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
RUN --mount=type=cache,target=/root/.cache/uv \
    --mount=type=bind,source=uv.lock,target=uv.lock \
    --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
    uv sync --frozen --package app

WORKDIR /app/backend/

CMD ["fastapi", "run", "--workers", "4"]

Hardened diff.

11 FROM oven/bun:1 AS frontend-build22 33 WORKDIR /app44 55 COPY package.json bun.lock /app/66 COPY frontend/package.json /app/frontend/77 88 WORKDIR /app/frontend99 1010 RUN bun install1111 1212 COPY ./frontend /app/frontend1313 1414 ARG VITE_API_URL=1515 1616 RUN bun run build1717 1818 1919 FROM python:3.142020 2121 ENV PYTHONUNBUFFERED=12222 2323 # Install uv2424 # Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv2525 COPY --from=ghcr.io/astral-sh/uv:0.9.26 /uv /uvx /bin/2626 2727 # Compile bytecode2828 # Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode2929 ENV UV_COMPILE_BYTECODE=13030 3131 # uv Cache3232 # Ref: https://docs.astral.sh/uv/guides/integration/docker/#caching3333 ENV UV_LINK_MODE=copy3434 3535 WORKDIR /app/3636 3737 # Place executables in the environment at the front of the path3838 # Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment3939 ENV PATH="/app/.venv/bin:$PATH"4040 4141 # Install dependencies4242 # Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers4343 RUN --mount=type=cache,target=/root/.cache/uv \4444     --mount=type=bind,source=uv.lock,target=uv.lock \4545     --mount=type=bind,source=pyproject.toml,target=pyproject.toml \4646     uv sync --frozen --no-install-workspace --package app4747 4848 COPY ./backend/scripts /app/backend/scripts4949 5050 COPY ./backend/pyproject.toml ./backend/alembic.ini /app/backend/5151 5252 COPY ./backend/app /app/backend/app5353 5454 COPY --from=frontend-build /app/backend/app/frontend /app/backend/app/frontend5555 5656 # Sync the project5757 # Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers5858 RUN --mount=type=cache,target=/root/.cache/uv \5959     --mount=type=bind,source=uv.lock,target=uv.lock \6060     --mount=type=bind,source=pyproject.toml,target=pyproject.toml \6161     uv sync --frozen --package app6262 6363 WORKDIR /app/backend/6464 6565 CMD ["fastapi", "run", "--workers", "4"]66+RUN (getent group 10001 >/dev/null 2>&1 || groupadd -r -g 10001 nonroot 2>/dev/null || addgroup -S -g 10001 nonroot) && (getent passwd 10001 >/dev/null 2>&1 || useradd -r -u 10001 -g 10001 -s /sbin/nologin nonroot 2>/dev/null || adduser -S -D -H -u 10001 -G nonroot nonroot) || (echo "rivex: could not create user nonroot with UID and GID 10001; set USER to the UID:GID of an existing non-root user" >&2 && exit 1)67+USER 10001:10001

Findings.

  • Missing: No USER instruction in the final stage (critical): No USER instruction in final stage; created user nonroot with UID 10001 and GID 10001 and set USER 10001:10001
  • Line 1 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 19 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Missing: No HEALTHCHECK in the final stage (low): Final stage has no HEALTHCHECK instruction
  • Missing: No # syntax= directive on the first line (medium): Dockerfile lacks BuildKit frontend pinning directive; add '# syntax=docker/dockerfile:1' as the first line for reproducible builds
  • Missing: No org.opencontainers.image.* LABEL in the final stage (low): No OCI image annotation labels found in the final stage; add LABEL org.opencontainers.image.source, .revision, and .version to enable image traceability

Generated .dockerignore.

.git/
.env
.env.*
*.pem
*.key
*.p12
*.pfx
id_rsa
id_dsa
*.der
.ssh/
.DS_Store
*.log
__pycache__/
*.pyc
.pytest_cache/

Next.js (Node, multi-stage, Alpine).

Copyright (c) 2025 Vercel, Inc. Next.js license (MIT). Original file: examples/with-docker/Dockerfile at commit 62e0b0a85fbf. The hardened Dockerfile below is a modified version produced by Rivex.

Original Dockerfile (112 lines)
# ============================================
# Stage 1: Dependencies Installation Stage
# ============================================

# IMPORTANT: Node.js Version Maintenance
# This Dockerfile uses Node.js 24.13.0-slim, which was the latest LTS version at the time of writing.
# To ensure security and compatibility, regularly update the NODE_VERSION ARG to the latest LTS version.
ARG NODE_VERSION=24.13.0-slim

FROM node:${NODE_VERSION} AS dependencies

# Set working directory
WORKDIR /app

# Copy package-related files first to leverage Docker's caching mechanism
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* pnpm-workspace.yaml* .npmrc* ./

# Install project dependencies with frozen lockfile for reproducible builds
RUN --mount=type=cache,target=/root/.npm \
    --mount=type=cache,target=/usr/local/share/.cache/yarn \
    --mount=type=cache,target=/root/.local/share/pnpm/store \
  if [ -f package-lock.json ]; then \
    npm ci --no-audit --no-fund; \
  elif [ -f yarn.lock ]; then \
    corepack enable yarn && yarn install --frozen-lockfile --production=false; \
  elif [ -f pnpm-lock.yaml ]; then \
    corepack enable pnpm && pnpm install --frozen-lockfile; \
  else \
    echo "No lockfile found." && exit 1; \
  fi

# ============================================
# Stage 2: Build Next.js application in standalone mode
# ============================================

FROM node:${NODE_VERSION} AS builder

# Set working directory
WORKDIR /app

# Copy project dependencies from dependencies stage
COPY --from=dependencies /app/node_modules ./node_modules

# Copy application source code
COPY . .

ENV NODE_ENV=production

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED=1

# Build Next.js application
# If you want to speed up Docker rebuilds, you can cache the build artifacts
# by adding: --mount=type=cache,target=/app/.next/cache
# This caches the .next/cache directory across builds, but it also prevents
# .next/cache/fetch-cache from being included in the final image, meaning
# cached fetch responses from the build won't be available at runtime.
RUN if [ -f package-lock.json ]; then \
    npm run build; \
  elif [ -f yarn.lock ]; then \
    corepack enable yarn && yarn build; \
  elif [ -f pnpm-lock.yaml ]; then \
    corepack enable pnpm && pnpm build; \
  else \
    echo "No lockfile found." && exit 1; \
  fi

# ============================================
# Stage 3: Run Next.js application
# ============================================

FROM node:${NODE_VERSION} AS runner

# Set working directory
WORKDIR /app

# Set production environment variables
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the run time.
# ENV NEXT_TELEMETRY_DISABLED=1

# Copy production assets
COPY --from=builder --chown=node:node /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown node:node .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=node:node /app/.next/standalone ./
COPY --from=builder --chown=node:node /app/.next/static ./.next/static

# If you want to persist the fetch cache generated during the build so that
# cached responses are available immediately on startup, uncomment this line:
# COPY --from=builder --chown=node:node /app/.next/cache ./.next/cache

# Switch to non-root user for security best practices
USER node

# Expose port 3000 to allow HTTP traffic
EXPOSE 3000

# Start Next.js standalone server
CMD ["node", "server.js"]

Hardened diff.

The engine did not change this Dockerfile.

Findings.

  • Line 106 (medium): Final USER is a user name, not a numeric UID; Kubernetes runAsNonRoot cannot verify it is non-root
  • Line 10 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 36 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 74 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Missing: No HEALTHCHECK in the final stage (low): Final stage has no HEALTHCHECK instruction
  • Line 16 (high): COPY instruction copies a credential file into the image; use RUN --mount=type=ssh or RUN --mount=type=secret,id=<name> instead
  • Lines 19–30 (low): RUN performs package-manager install; for reproducibility pin versions and cache package lists with RUN --mount=type=cache (e.g. target=/var/cache/apt,sharing=locked) and clean lists in the same layer
  • Missing: No # syntax= directive on the first line (medium): Dockerfile lacks BuildKit frontend pinning directive; add '# syntax=docker/dockerfile:1' as the first line for reproducible builds
  • Line 45 (medium): COPY/ADD copies entire build context; list specific files or directories to reduce image size and avoid leaking sensitive files
  • Missing: No org.opencontainers.image.* LABEL in the final stage (low): No OCI image annotation labels found in the final stage; add LABEL org.opencontainers.image.source, .revision, and .version to enable image traceability
  • Line 16 (critical): COPY .npmrc* was not rewritten: the source is a directory or pattern, or its destination cannot be resolved; move it to a build secret or runtime injection yourself and rotate the exposed value

Generated .dockerignore.

.git/
.env
.env.*
*.pem
*.key
*.p12
*.pfx
id_rsa
id_dsa
*.der
.ssh/
.DS_Store
*.log
node_modules/
.npm
dist/

restic (Go, multi-stage, Alpine).

Copyright (c) 2014, Alexander Neumann <alexander@bumpern.de>. restic license (BSD-2-Clause). Original file: docker/Dockerfile at commit 1765e36f95b6. The hardened Dockerfile below is a modified version produced by Rivex.

Original Dockerfile (24 lines)
FROM golang:1.27-alpine AS builder

WORKDIR /go/src/github.com/restic/restic

# Caching dependencies
COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN go run build.go
FROM alpine:latest AS restic
RUN apk add --no-cache ca-certificates fuse openssh-client tzdata jq

COPY --from=builder /go/src/github.com/restic/restic/restic /usr/bin
COPY ./docker/entrypoint.sh /entrypoint.sh

# IO class default is "none"- 0, however busybox reject ionice `-c0 -n<something>`
# since priority has no meaning for no scheduler.
# Thus the entrypoint script below is necessary
ENV IONICE_CLASS=
ENV IONICE_PRIORITY=4
ENV NICE=0

ENTRYPOINT ["/entrypoint.sh"]

Hardened diff.

11 FROM golang:1.27-alpine AS builder22 33 WORKDIR /go/src/github.com/restic/restic44 55 # Caching dependencies66 COPY go.mod go.sum ./77 RUN go mod download88 99 COPY . .1010 RUN go run build.go1111 FROM alpine:latest AS restic1212 RUN apk add --no-cache ca-certificates fuse openssh-client tzdata jq1313 1414 COPY --from=builder /go/src/github.com/restic/restic/restic /usr/bin1515 COPY ./docker/entrypoint.sh /entrypoint.sh1616 1717 # IO class default is "none"- 0, however busybox reject ionice `-c0 -n<something>`1818 # since priority has no meaning for no scheduler.1919 # Thus the entrypoint script below is necessary2020 ENV IONICE_CLASS=2121 ENV IONICE_PRIORITY=42222 ENV NICE=02323 2424 ENTRYPOINT ["/entrypoint.sh"]25+RUN (getent group 10001 >/dev/null 2>&1 || groupadd -r -g 10001 nonroot 2>/dev/null || addgroup -S -g 10001 nonroot) && (getent passwd 10001 >/dev/null 2>&1 || useradd -r -u 10001 -g 10001 -s /sbin/nologin nonroot 2>/dev/null || adduser -S -D -H -u 10001 -G nonroot nonroot) || (echo "rivex: could not create user nonroot with UID and GID 10001; set USER to the UID:GID of an existing non-root user" >&2 && exit 1)26+USER 10001:10001

Findings.

  • Missing: No USER instruction in the final stage (critical): No USER instruction in final stage; created user nonroot with UID 10001 and GID 10001 and set USER 10001:10001
  • Line 1 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 11 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 11 (medium): Base image uses the mutable :latest tag; replace with an explicit version tag.
  • Missing: No HEALTHCHECK in the final stage (low): Final stage has no HEALTHCHECK instruction
  • Line 12 (low): RUN performs package-manager install; for reproducibility pin versions and cache package lists with RUN --mount=type=cache (e.g. target=/var/cache/apt,sharing=locked) and clean lists in the same layer
  • Missing: No # syntax= directive on the first line (medium): Dockerfile lacks BuildKit frontend pinning directive; add '# syntax=docker/dockerfile:1' as the first line for reproducible builds
  • Line 12 (low): unpinned package install detected (apk); pin to exact versions for reproducible builds
  • Line 9 (medium): COPY/ADD copies entire build context; list specific files or directories to reduce image size and avoid leaking sensitive files
  • Missing: No org.opencontainers.image.* LABEL in the final stage (low): No OCI image annotation labels found in the final stage; add LABEL org.opencontainers.image.source, .revision, and .version to enable image traceability
  • Line 12 (medium): package manager install in final stage; move build-time package installation to a builder stage and COPY only the required artifacts into the final image

Generated .dockerignore.

.git/
.env
.env.*
*.pem
*.key
*.p12
*.pfx
id_rsa
id_dsa
*.der
.ssh/
.DS_Store
*.log
vendor/
bin/

Baeldung tutorials (Java, multi-stage).

Copyright (c) 2017 Eugen Paraschiv. Baeldung tutorials license (MIT). Original file: apache-seata/shop-service/Dockerfile at commit 79cbeb69ff5d. The hardened Dockerfile below is a modified version produced by Rivex.

Original Dockerfile (18 lines)
FROM maven:3.9.13-eclipse-temurin-17-alpine AS build

WORKDIR /app

COPY pom.xml .
RUN mvn compile

COPY . .
RUN mvn clean package -DskipTests



FROM eclipse-temurin:17

WORKDIR /app
COPY --from=build /app/target/*.jar app.jar

ENTRYPOINT ["java", "-jar", "app.jar"]

Hardened diff.

11 FROM maven:3.9.13-eclipse-temurin-17-alpine AS build22 33 WORKDIR /app44 55 COPY pom.xml .66 RUN mvn compile77 88 COPY . .99 RUN mvn clean package -DskipTests1010 1111 1212 1313 FROM eclipse-temurin:171414 1515 WORKDIR /app1616 COPY --from=build /app/target/*.jar app.jar1717 1818 ENTRYPOINT ["java", "-jar", "app.jar"]19+RUN (getent group 10001 >/dev/null 2>&1 || groupadd -r -g 10001 nonroot 2>/dev/null || addgroup -S -g 10001 nonroot) && (getent passwd 10001 >/dev/null 2>&1 || useradd -r -u 10001 -g 10001 -s /sbin/nologin nonroot 2>/dev/null || adduser -S -D -H -u 10001 -G nonroot nonroot) || (echo "rivex: could not create user nonroot with UID and GID 10001; set USER to the UID:GID of an existing non-root user" >&2 && exit 1)20+USER 10001:10001

Findings.

  • Missing: No USER instruction in the final stage (critical): No USER instruction in final stage; created user nonroot with UID 10001 and GID 10001 and set USER 10001:10001
  • Line 1 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Line 13 (critical): Base image is not digest-pinned; pin with @sha256:<digest>
  • Missing: No HEALTHCHECK in the final stage (low): Final stage has no HEALTHCHECK instruction
  • Missing: No # syntax= directive on the first line (medium): Dockerfile lacks BuildKit frontend pinning directive; add '# syntax=docker/dockerfile:1' as the first line for reproducible builds
  • Line 8 (medium): COPY/ADD copies entire build context; list specific files or directories to reduce image size and avoid leaking sensitive files
  • Missing: No org.opencontainers.image.* LABEL in the final stage (low): No OCI image annotation labels found in the final stage; add LABEL org.opencontainers.image.source, .revision, and .version to enable image traceability

Generated .dockerignore.

.git/
.env
.env.*
*.pem
*.key
*.p12
*.pfx
id_rsa
id_dsa
*.der
.ssh/
.DS_Store
*.log

Harden your own Dockerfiles.

Rivex is in early access. Join the waitlist to run it on your own Dockerfiles.

Request early access