# # This Dockerfile is used for self-hosted production builds. # # PostHog has sunset support for self-hosted K8s deployments. # See: https://posthog.com/blog/sunsetting-helm-support-posthog # # Note: PostHog Cloud uses this same image (re-tagged to ECR posthog-cloud); there is no separate Dockerfile.cloud. # # The stages are used to: # # - node-base: shared Node.js base with pnpm already provisioned # - product-manifests: collect the package.json of each products/* workspace package # - frontend-build: build the frontend (static assets) # - frontend-dist: the frontend/dist that ships, which CI replaces once it uploaded the sourcemaps # - node-scripts-build: build plugin transpiler and other Node.js build artifacts # - cli-catalog-build: build the API tool catalog that hog downloads from /api/cli/catalog.json # - posthog-build: fetch PostHog (Django app) dependencies & build Django collectstatic # - fetch-geoip-db: fetch the GeoIP database # # Node.js services are built separately using Dockerfile.node. # # In the last stage, we import the artifacts from the previous # stages, add some runtime dependencies and build the final image. # # # --------------------------------------------------------- # # Digest-pinned because the runtime stage copies its `node` binary out of this stage. FROM node:26.13.1-bookworm-slim@sha256:5df79989ed685e09f0a98019db4cebfb22fb9df1a53c0161664a011f7ff6b0f1 AS node-base WORKDIR /code SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] # corepack fetches the pinned pnpm with a bare fetch() — no timeout, no retries — so a stalled # registry connection blocks until the job timeout kills the build. Seeding it here keeps that fetch # off every source change: only a root package.json edit re-runs this layer. Then take corepack off # the network, so a pin this layer does not cover fails in milliseconds naming the URL it wanted. COPY package.json ./ RUN npm install -g corepack@0.36.0 && corepack enable && corepack install ENV COREPACK_ENABLE_NETWORK=0 # Turbo sends usage events to telemetry.vercel.com on every run unless this is set. ENV TURBO_TELEMETRY_DISABLED=1 # # --------------------------------------------------------- # # Only the package.json files, so a product source change does not rerun the frontend pnpm install. FROM node:26.13.1-bookworm-slim@sha256:5df79989ed685e09f0a98019db4cebfb22fb9df1a53c0161664a011f7ff6b0f1 AS product-manifests COPY products/ /tmp/products/ RUN cd /tmp/products && for manifest in */package.json; do install -D -m 644 "$manifest" "/manifests/products/$manifest"; done # # --------------------------------------------------------- # FROM node-base AS frontend-build # re2's prebuilt Node 26 binaries need glibc 2.38 and bookworm ships 2.36, so re2 compiles from source here. RUN apt-get update && \ apt-get install -y --no-install-recommends python3 make g++ && \ rm -rf /var/lib/apt/lists/* COPY turbo.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./ COPY frontend/package.json frontend/ COPY frontend/bin/ frontend/bin/ COPY bin/ bin/ COPY patches/ patches/ COPY common/hogvm/typescript/ common/hogvm/typescript/ COPY common/esbuilder/ common/esbuilder/ COPY common/replay-shared/ common/replay-shared/ COPY common/tailwind/ common/tailwind/ COPY packages/quill/ packages/quill/ COPY packages/llm-normalizer/ packages/llm-normalizer/ COPY packages/agent/packages/agent-contracts/src/ packages/agent/packages/agent-contracts/src/ COPY --from=product-manifests /manifests/products/ products/ COPY docs/onboarding/ docs/onboarding/ RUN --mount=type=cache,id=pnpm,target=/tmp/pnpm-store-v24 \ CI=1 pnpm --filter=@posthog/frontend... install --frozen-lockfile --store-dir /tmp/pnpm-store-v24 COPY products/ products/ COPY frontend/ frontend/ RUN bin/turbo --filter=@posthog/frontend build # # --------------------------------------------------------- # # The frontend/dist that ships, and products.json. This build uploads nothing and keeps the .map files. # CI exports this stage with `--target frontend-dist --output type=local` and uploads the sourcemaps # from the job, where its credentials never enter a build (see # .github/scripts/upload-frontend-sourcemaps.sh). hog deletes each map it uploaded and the reference to # it, and CI passes that tree back as a build context named frontend-dist, which replaces this stage. # Later stages read the frontend only from this stage, so with that context the image build never runs # frontend-build, for any platform. # FROM scratch AS frontend-dist COPY --from=frontend-build /code/frontend/dist /code/frontend/dist COPY --from=frontend-build /code/frontend/src/products.json /code/frontend/src/products.json # # --------------------------------------------------------- # # Build plugin transpiler and other Node.js build artifacts. # FROM node-base AS node-scripts-build # Build plugin transpiler for site destinations/apps COPY turbo.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./ COPY bin/turbo bin/turbo COPY patches/ patches/ COPY common/esbuilder/ common/esbuilder/ COPY common/plugin_transpiler/ common/plugin_transpiler/ RUN --mount=type=cache,id=pnpm,target=/tmp/pnpm-store-v24 \ NODE_OPTIONS="--max-old-space-size=4096" CI=1 pnpm --filter=@posthog/plugin-transpiler... install --frozen-lockfile --store-dir /tmp/pnpm-store-v24 && \ NODE_OPTIONS="--max-old-space-size=4096" bin/turbo --filter=@posthog/plugin-transpiler build COPY products/canvas/packages/canvas_builder/ products/canvas/packages/canvas_builder/ RUN --mount=type=cache,id=npm,target=/root/.npm \ npm ci --ignore-scripts --omit=dev --no-audit --no-fund --prefix products/canvas/packages/canvas_builder # The transpiler bundle externalizes @babel/standalone (its only external runtime require — a # self-contained 24MB package with no deps). Materialize it as real files inside the transpiler's # own node_modules, replacing the pnpm symlink that pointed into the root node_modules. The final # image then carries just this package instead of the entire ~469MB root /code/node_modules. RUN cd /code/common/plugin_transpiler && \ BABEL_REAL=$(node -e "process.stdout.write(require('path').dirname(require.resolve('@babel/standalone/package.json')))") && \ rm -rf node_modules/@babel/standalone && \ mkdir -p node_modules/@babel && \ cp -rL "$BABEL_REAL" node_modules/@babel/standalone # # --------------------------------------------------------- # # The API tool catalog that hog downloads from /api/cli/catalog.json, built from the MCP tool code of # this commit. The script exits non-zero when it can't build the catalog, which fails the image build. # FROM node-base AS cli-catalog-build COPY pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./ COPY patches/ patches/ COPY services/mcp/package.json services/mcp/ COPY tools/openapi-codegen/package.json tools/openapi-codegen/ COPY packages/ packages/ # No install scripts: the catalog build only needs esbuild and tsx, which run from their platform packages. RUN --mount=type=cache,id=pnpm,target=/tmp/pnpm-store-v24 \ CI=1 pnpm --filter=@posthog/mcp... install --frozen-lockfile --ignore-scripts --store-dir /tmp/pnpm-store-v24 COPY services/mcp/ services/mcp/ # The tool code imports a few files from products/. COPY products/ products/ RUN cd services/mcp && pnpm run build:cli:catalog && test -s dist/cli-catalog.json # # --------------------------------------------------------- # FROM ghcr.io/astral-sh/uv:0.13.10 AS uv # Same as pyproject.toml so that uv can pick it up and doesn't need to download a different Python version. FROM python:3.14.10-slim-bookworm@sha256:e60ad028afdcdd14772a3d46decf0eaf616720f9102aeb4397a2045ff6718c3d AS posthog-build COPY --from=uv /uv /uvx /bin/ WORKDIR /code SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] # uv settings for Docker builds ENV UV_COMPILE_BYTECODE=1 ENV UV_LINK_MODE=copy ENV UV_PROJECT_ENVIRONMENT=/python-runtime # Install build dependencies RUN apt-get update && \ apt-get install -y --no-install-recommends \ "build-essential" \ "bzip2" \ "curl" \ "git" \ "libpq-dev" \ "libssl-dev" \ "libffi-dev" \ "zlib1g-dev" \ "pkg-config" \ && \ rm -rf /var/lib/apt/lists/* # pymssql is built from source below and links this FreeTDS statically, in place of the copy in its wheels. # Bumping FREETDS_VERSION also needs the uv cache id below changed, or uv reuses the pymssql wheel it built before. ARG FREETDS_VERSION=1.5.22 ARG FREETDS_SHA256=b31cbc50f9e2ad4adf8dd3958807e4e7b8f4e588b080f8dbddbe465ceefb9231 # Setting CFLAGS drops autoconf's default -O2, so the optimisation and hardening flags are spelled out. # The nm check fails the build if the stack protector did not make it into the archive. RUN curl -fsSL -o /tmp/freetds.tar.bz2 "https://github.com/FreeTDS/freetds/releases/download/v${FREETDS_VERSION}/freetds-${FREETDS_VERSION}.tar.bz2" && \ echo "${FREETDS_SHA256} /tmp/freetds.tar.bz2" | sha256sum -c - && \ mkdir /tmp/freetds && \ tar -xjf /tmp/freetds.tar.bz2 -C /tmp/freetds --strip-components=1 && \ cd /tmp/freetds && \ CFLAGS="-fPIC -O2 -fstack-protector-strong" CPPFLAGS="-D_FORTIFY_SOURCE=2" ./configure --prefix=/opt/freetds \ --enable-msdblib --disable-server --disable-pool --disable-odbc --disable-apps \ --with-openssl=yes --with-gnutls=no --enable-static --disable-shared && \ make -j"$(nproc)" && \ make install && \ nm /opt/freetds/lib/libsybdb.a | grep -c __stack_chk_fail >/dev/null && \ rm -rf /tmp/freetds /tmp/freetds.tar.bz2 # Install Python dependencies using cache mount for faster rebuilds # Cache ID includes the FreeTDS version to bust cache when that library changes RUN --mount=type=cache,id=uv-freetds1.5.22,target=/root/.cache/uv \ --mount=type=bind,source=uv.lock,target=uv.lock \ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ --mount=type=bind,source=tools/hogli,target=tools/hogli \ # uv sync validates workspace membership even with --no-dev, so every workspace member must be # present in the build context. packages/owners-yaml is also a real install source here: owners-yaml # is a runtime dependency (stamphog's digest reads owners.yaml through it), and --no-editable # copies it into the venv so the image never depends on this bind mount's path surviving. --mount=type=bind,source=packages/owners-yaml,target=packages/owners-yaml \ --mount=type=bind,source=packages/personhog-proto,target=packages/personhog-proto \ # The FreeTDS build above has no Kerberos support, so pymssql must not link krb5. PYMSSQL_FREETDS=/opt/freetds LINK_KRB5=NO \ # lxml and xmlsec install from their PyPI wheels, which bundle libxml2, libxslt and xmlsec1. A source # build would link Debian's libxml2 instead, and bookworm and trixie both ship 2.9.14. uv sync --locked --no-dev --no-editable --no-install-project --no-binary-package pymssql ENV PATH=/python-runtime/bin:$PATH \ PYTHONPATH=/python-runtime # Fails the build if pymssql came from a PyPI wheel instead of linking the FreeTDS built above. RUN python -c "import pymssql, sys; v = pymssql.get_dbversion(); print(v); sys.exit(0 if 'v${FREETDS_VERSION}' in v else v)" # Fails the build if lxml and xmlsec do not carry the same libxml2, or carry one older than 2.11. xmlsec # passes lxml's nodes to its own libxml2, so the two copies must be the same version. A libxml2 older # than 2.11 means one of the packages was built against Debian's library. RUN python -c "import sys, lxml.etree as etree, xmlsec; got = {etree.LIBXML_VERSION, etree.LIBXML_COMPILED_VERSION, xmlsec.get_libxml_version(), xmlsec.get_libxml_compiled_version()}; print(got, xmlsec.get_libxmlsec_version()); sys.exit(0 if len(got) == 1 and min(got) >= (2, 11) else f'lxml and xmlsec need one libxml2 at 2.11 or later, got {got}')" # Pre-warm the tiktoken BPE encoding cache into the image so runtime token counting reads the # blobs from disk instead of fetching them from OpenAI's blob host on first use, which fails under # restricted egress or flaky DNS. Covers the two encodings our callers resolve to: o200k_base # (gpt-4o) and cl100k_base (text-embedding-3-small). The cache is keyed by the blob URL, which is # stable for the pinned tiktoken version, so the baked files are used verbatim at runtime. ENV TIKTOKEN_CACHE_DIR=/code/.tiktoken_cache RUN mkdir -p "$TIKTOKEN_CACHE_DIR" && \ python -c "import tiktoken; [tiktoken.get_encoding(e) for e in ('o200k_base', 'cl100k_base')]" # Add in Django deps COPY manage.py manage.py COPY common/esbuilder common/esbuilder COPY common/hogvm common/hogvm/ COPY common/migration_utils common/migration_utils/ COPY common/log-scrubbing/credentials.txt common/log-scrubbing/ COPY posthog posthog/ COPY products/ products/ COPY ee ee/ # Copy the frontend assets and also the products.json file. hog injects chunk IDs into the JS before it # uploads the maps, so the runtime JS must come from the same processed tree. COPY --from=frontend-dist /code/frontend/dist /code/frontend/dist COPY --from=frontend-dist /code/frontend/src/products.json /code/frontend/src/products.json # Make sure we build the static files RUN SKIP_SERVICE_VERSION_REQUIREMENTS=1 STATIC_COLLECTION=1 DATABASE_URL='postgres:///' REDIS_URL='redis:///' python manage.py collectstatic --noinput # Render the wizard tool catalog from the warehouse source declarations. Web workers serve this file, # so they never import every source module, and a source module that fails to import fails the build. RUN SKIP_SERVICE_VERSION_REQUIREMENTS=1 STATIC_COLLECTION=1 DATABASE_URL='postgres:///' REDIS_URL='redis:///' python manage.py render_wizard_tool_catalog # No sourcemap ships as a static file. Error tracking reads the maps that CI uploads, and Python # packages such as Django REST framework bring maps that nothing uploads. When CI could not upload, # /code/frontend/dist keeps the only copy of the frontend maps, so this deletes only the collected # duplicates and their compressed variants. This runs here, not in the final stage, so that the bytes # never enter the COPYed layers. RUN find /code/staticfiles \( -name '*.map' -o -name '*.map.gz' -o -name '*.map.br' \) -delete # # --------------------------------------------------------- # FROM debian:bookworm-slim AS fetch-geoip-db WORKDIR /code SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] # Fetch the GeoLite2-City database that will be used for IP geolocation within Django. RUN apt-get update && \ apt-get install -y --no-install-recommends \ "ca-certificates" \ "curl" \ "brotli" \ && \ rm -rf /var/lib/apt/lists/* && \ mkdir share && \ ( curl -s -L "https://mmdbcdn.posthog.net/" --http1.1 | brotli --decompress --output=./share/GeoLite2-City.mmdb ) && \ chmod -R 755 ./share/GeoLite2-City.mmdb # # --------------------------------------------------------- # # Same digest as the posthog-build stage, so the interpreter matches the one the wheels were built against. FROM python:3.14.10-slim-bookworm@sha256:e60ad028afdcdd14772a3d46decf0eaf616720f9102aeb4397a2045ff6718c3d WORKDIR /code SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] ENV PYTHONUNBUFFERED=1 # Granian embeds libpython instead of launching the python3 CLI, so PEP 538 C-locale # coercion never runs and open() defaults to ASCII under the container's bare locale. # Force UTF-8 so file reads with non-ASCII bytes don't raise UnicodeDecodeError. ENV PYTHONUTF8=1 ENV LANG=C.UTF-8 # Install OS runtime dependencies. # Note: please add in this stage runtime dependences only! # libxml2 and libxmlsec1 are not installed here: the lxml and xmlsec wheels bundle their own copies. RUN apt-get update && \ apt-get install -y --no-install-recommends --allow-downgrades \ # Upgrades the CA bundle that the pinned base image freezes. "ca-certificates" \ # The deploy chart's asset-upload hook runs in this image and downloads s5cmd with curl. "curl" \ "git" \ "libpq5" \ # libssl pinned to the 3.0 series (ABI-stable), not an exact version: Debian rotates # point releases out of the security archive, which breaks exact pins on uncached builds. "libssl3=3.0.*" \ "libjemalloc2" \ # The node binary copied from node-base links libatomic from Node 26 on. "libatomic1" \ # Numba's OpenMP backend needs the system libgomp runtime. "libgomp1" \ # Python's mimetypes uses /etc/mime.types for artifact content types. "media-types" \ # psutil is not installed, so joblib's loky kills worker process trees with pgrep. # Operators also need ps to find a PID for py-spy. "procps" \ # Kubernetes runs the container command as PID 1, and PID 1 drops a signal that it has no # handler for. Deployments that run their command under tini get a PID 1 that always handles # SIGTERM, forwards it to the command and reaps orphaned processes. "tini" \ # The base image digest freezes its tzdata. HogQL prints datetime constants as local time in # the team's timezone, and ClickHouse resolves them with its own tz rules. When a zone's rules # change and this image lags, both sides disagree on the UTC offset and queries shift their # time bounds. Listing tzdata here upgrades it to the newest Debian release whenever this # layer is rebuilt. A cached layer keeps the tzdata it was built with. "tzdata" \ && \ rm -rf /var/lib/apt/lists/* # Note: no MS SQL ODBC driver is installed — the data-warehouse MSSQL source uses pymssql, which # links FreeTDS statically in the posthog-build stage and does not use msodbcsql18/unixodbc (there is # no pyodbc in the tree). Its OpenSSL link is satisfied by libssl3 above. # Only the `node` binary is used at runtime (the plugin transpiler subprocess). Note: the dev-only # `create_channel_definitions_file` management command shells out to `npx prettier` to regenerate a # checked-in file; it is not run in this image. COPY --from=node-base /usr/local/bin/node /usr/local/bin/node RUN ln -s /usr/local/bin/node /usr/local/bin/nodejs && node --version # Install and use a non-root user. # Pin uid/gid to a fixed, host-safe value (avoid 1000, which maps to ec2-user on the nodes). RUN groupadd -g 10001 posthog && \ useradd -u 10001 -g posthog -m -d /home/posthog -s /bin/bash posthog && \ chown posthog:posthog /code USER posthog # Rarely changed layers go first. A changed layer forces a rebuild of every layer after it. # Copy the Python dependencies from the posthog-build stage. COPY --from=posthog-build --chown=posthog:posthog /python-runtime /python-runtime ENV PATH=/python-runtime/bin:$PATH \ PYTHONPATH=/python-runtime # Copy the GeoLite2-City database from the fetch-geoip-db stage. COPY --from=fetch-geoip-db --chown=posthog:posthog /code/share/GeoLite2-City.mmdb /code/share/GeoLite2-City.mmdb # Copy the pre-warmed tiktoken encoding cache and point tiktoken at it so token counting never # reaches out to OpenAI's blob host at runtime (see the posthog-build stage for details). COPY --from=posthog-build --chown=posthog:posthog /code/.tiktoken_cache /code/.tiktoken_cache ENV TIKTOKEN_CACHE_DIR=/code/.tiktoken_cache # Copy plugin transpiler (used by Django for site destinations/apps). The transpiler dist is a # self-contained esbuild bundle (build.mjs uses bundle:true), so only its own dist + node_modules # are needed at runtime — the full root /code/node_modules COPY was redundant. COPY --from=node-scripts-build --chown=posthog:posthog /code/common/plugin_transpiler/dist /code/common/plugin_transpiler/dist COPY --from=node-scripts-build --chown=posthog:posthog /code/common/plugin_transpiler/node_modules /code/common/plugin_transpiler/node_modules COPY --from=node-scripts-build --chown=posthog:posthog /code/common/plugin_transpiler/package.json /code/common/plugin_transpiler/package.json COPY --from=node-scripts-build --chown=posthog:posthog /code/products/canvas/packages/canvas_builder /code/products/canvas/packages/canvas_builder # Copy the Django staticfiles from the posthog-build stage. COPY --from=posthog-build --chown=posthog:posthog /code/staticfiles /code/staticfiles # frontend/dist is read at runtime (Django template DIR in settings/web.py + the array.js disk # fallback in js_snippet_versioning.py), so this COPY is load-bearing. Sourced from posthog-build, # so it is the tree collectstatic read. COPY --from=posthog-build --chown=posthog:posthog /code/frontend/dist /code/frontend/dist # Copy products.json from the frontend-dist stage COPY --from=frontend-dist --chown=posthog:posthog /code/frontend/src/products.json /code/frontend/src/products.json # Add in custom bin files and Django deps. COPY --chown=posthog:posthog ./bin ./bin/ # Persons SQL migration files (read by apply_persons_migrations management command for hobby deploys) COPY --chown=posthog:posthog ./rust/persons_migrations ./rust/persons_migrations/ COPY --chown=posthog:posthog ./rust/persons_migrations_hobby ./rust/persons_migrations_hobby/ COPY --chown=posthog:posthog manage.py manage.py COPY --chown=posthog:posthog posthog posthog/ COPY --chown=posthog:posthog ee ee/ COPY --chown=posthog:posthog common/hogvm common/hogvm/ COPY --chown=posthog:posthog common/migration_utils common/migration_utils/ COPY --chown=posthog:posthog common/log-scrubbing/credentials.txt common/log-scrubbing/ COPY --chown=posthog:posthog products products/ COPY --from=posthog-build --chown=posthog:posthog /code/products/wizard/tool-catalog.json /code/products/wizard/tool-catalog.json # Stamphog ships the review engine + owners resolver from this checkout into its sandbox at # runtime (products/stamphog/backend/temporal/activities.py), so both must exist in the image as # source, the engine with its default policy files. The engine arrives with products/ above, and only packages/owners-yaml needs its own COPY. This # differs from the installation of owners-yaml into the venv as a library: the sandbox receives # files copied into a checkout, and not an import. COPY --chown=posthog:posthog packages/owners-yaml packages/owners-yaml/ RUN test -f products/stamphog/packages/pr-approval-agent/review_local.py && test -f products/stamphog/packages/pr-approval-agent/defaults/policy.yml && test -d packages/owners-yaml/owners_yaml # Generated MCP tool catalog, read at runtime from BASE_DIR by the OAuth consent page # (posthog/api/oauth/mcp_resource_scopes.py) and the tasks permission broker. The rest of # services/ is a Node build (Dockerfile.node) and deliberately stays out of this image. COPY --chown=posthog:posthog services/mcp/schema services/mcp/schema/ # Served by posthog/api/cli_catalog.py. COPY --from=cli-catalog-build --chown=posthog:posthog /code/services/mcp/dist/cli-catalog.json /code/services/mcp/dist/cli-catalog.json # Pre-compile first-party bytecode. Site-packages are already compiled (UV_COMPILE_BYTECODE=1), but # the app runs as `nobody` (bin/docker-server), which cannot write __pycache__ under the posthog-owned # /code, so without this every process compiled ~1300 first-party modules in memory at every start. # Test modules are skipped to keep the layer small. Default (timestamp) validation: one stat per # module, and a later COPY of edited .py files still takes effect. See docs/internal/django-startup-time.md. RUN /python-runtime/bin/python -m compileall -q -j 0 -x '/tests?/' \ manage.py posthog ee common/hogvm common/migration_utils products packages/owners-yaml # Validate the Playwright client library (used to drive the remote browserless service over CDP — # no browser binary ships in this image). RUN /python-runtime/bin/python -c "import playwright; print('Playwright package imported successfully')" RUN /python-runtime/bin/python -c "from playwright.sync_api import sync_playwright; print('Playwright sync API available')" # Setup ENV. ENV NODE_ENV=production # Expose container port and run entry point script. EXPOSE 8000 # Expose the port from which we serve OpenMetrics data. EXPOSE 8001 # Add the commit hash ARG COMMIT_HASH RUN echo $COMMIT_HASH > /code/commit.txt # The error tracking release this build belongs to. The CD workflow creates the release before the # build and passes its id in (see "Resolve error tracking release" in # .github/workflows/container-images-cd.yml). The Python SDK reads POSTHOG_RELEASE_ID and sends it as # $release_id on every event, so a backend exception resolves to the same release as the frontend # bundles. Empty in every other build, which the SDK treats as unset. ARG POSTHOG_RELEASE_ID ENV POSTHOG_RELEASE_ID=$POSTHOG_RELEASE_ID # Root is needed only so bin/docker-server can drop the app to nobody with setpriv. # nosemgrep: dockerfile.security.last-user-is-root.last-user-is-root USER root CMD ["./bin/docker"]