LibreChat/.oss-scanner/Dockerfile
Marco Beretta effcec615d
🐳 fix: Qualify Docker Hub Image Names in Compose Files and Dockerfiles (#17950)
* fix: Qualify Docker Hub Image Names in Compose Files and Dockerfiles

Podman has no default registry, so a short image name such as mongo:8.0.20
or pgvector/pgvector:0.8.0-pg15-trixie fails with "short-name did not
resolve to an alias" unless the host configures unqualified-search
registries. Name docker.io on every third-party image in the compose files,
the override example and the Dockerfiles, using docker.io/library/ for
official images. Tags and digests are unchanged.

scripts/images.test.mjs fails on any image a compose file or Dockerfile
pulls without a registry host, and Static Checks runs it when one of those
files changes.

* test: Harden the image name scanner for indented comments and variable defaults

Commented image lines are matched at any indentation, a variable with an empty default or more than one interpolation is not guessed, and a Dockerfile FROM with a default is judged by that default, as in compose files.

* fix: Qualify the Channel Gateway and Mongo Replica Images

The channel compose stack landed on dev with short names, which the image name test now rejects.
2026-11-14 21:47:59 +01:00

28 lines
970 B
Docker

FROM docker.io/library/node:24.22.3-bookworm
ENV DEBIAN_FRONTEND=noninteractive \
SCARF_ANALYTICS=false \
HUSKY=0 \
MONGOMS_DOWNLOAD_DIR=/opt/mongodb-binaries \
MONGOMS_RUNTIME_DOWNLOAD=false \
PLAYWRIGHT_BROWSERS_PATH=/opt/playwright
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git python3 build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& npm install --global npm@11.13.0
WORKDIR /src
COPY . .
RUN npm ci --include=dev --no-audit --no-fund
RUN npm run frontend
# Fetch test binaries while the build still has network access.
RUN MONGOMS_RUNTIME_DOWNLOAD=true node -e \
"require('mongodb-memory-server-core').MongoBinary.getPath({}).then(console.log).catch(error => { console.error(error); process.exit(1); })" \
&& npx --no-install playwright install --with-deps chromium \
&& chmod -R a+rX /opt/mongodb-binaries /opt/playwright \
&& npm cache clean --force
CMD ["bash"]