1- FROM debian:12-slim@sha256:b1a741487078b369e78119849663d7f1a5341ef2768798f7b7406c4240f86aef AS debian-updated
2-
3- SHELL ["/bin/bash" , "-euo" , "pipefail" , "-c" ]
4-
5- # If we ever need to bust the cache, just change the date here.
6- # While we don't cache anything in Drone, that might not be true when we migrate to GitHub Actions where some action might automatically enable layer caching.
7- # This is fine, but is terrible in situations where we want to _force_ an update of a package.
8- RUN echo 'cachebuster 2025-10-17' && apt-get update
9-
10- FROM debian-updated AS debs
11-
12- ARG CHROMIUM_VERSION=141.0.7390.107
13- RUN apt-cache depends chromium=${CHROMIUM_VERSION} chromium-driver chromium-shell chromium-sandbox font-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 unifont fonts-open-sans fonts-roboto fonts-inter bash util-linux openssl tini ca-certificates locales libnss3-tools \
14- --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends | grep '^\w ' | xargs apt-get download
15- RUN mkdir /dpkg && \
16- find . -type f -name '*.deb' -exec sh -c 'dpkg --extract "$1" /dpkg || exit 5' sh '{}' \;
17-
18- FROM debian:testing-slim@sha256:12ce5b90ca703a11ebaae907649af9b000e616f49199a2115340e0cdf007e42a AS ca-certs
19-
20- RUN apt-get update
21- RUN apt-cache depends ca-certificates \
22- --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends | grep '^\w ' | xargs apt-get download
23- RUN mkdir /dpkg && \
24- find . -type f -name '*.deb' -exec sh -c 'dpkg --extract "$1" /dpkg || exit 5' sh '{}' \;
25-
26- # While we can't move to Debian 13 yet for the final image, use its new build of busybox with security fixes.
27- FROM debian:13-slim@sha256:c85a2732e97694ea77237c61304b3bb410e0e961dd6ee945997a06c788c545bb AS busybox
28-
29- RUN apt-get update
30- RUN apt-cache depends busybox-static \
31- --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends | grep '^\w ' | xargs apt-get download
32- RUN mkdir /dpkg && \
33- find . -type f -name '*.deb' -exec sh -c 'dpkg --extract "$1" /dpkg || exit 5' sh '{}' \;
34-
35- FROM node:22-alpine@sha256:1b2479dd35a99687d6638f5976fd235e26c5b37e8122f786fcd5fe231d63de5b AS build
1+ FROM node:22-trixie AS build
362
373WORKDIR /src
384COPY . ./
@@ -41,48 +7,49 @@ RUN yarn install --pure-lockfile
417RUN yarn run build
428RUN rm -rf node_modules/ && yarn install --pure-lockfile --production
439
44- FROM gcr.io/distroless/nodejs22-debian12:nonroot@sha256:8929dbab735ee399ff886ba7d81419dbe7df002993a7d69715e1c16b7d41c531
10+ FROM node:22-trixie AS output_image
4511
4612LABEL maintainer=
"Grafana team <[email protected] >" 4713LABEL org.opencontainers.image.source="https://github.com/grafana/grafana-image-renderer/tree/master/Dockerfile"
4814
49- COPY --from=debs /dpkg /
50- COPY --from=busybox /dpkg/usr/bin/busybox /bin/busybox
51- COPY --from=busybox /dpkg/usr/bin/busybox /usr/bin/busybox
52- COPY --from=ca-certs /dpkg/usr/share/ca-certificates /usr/share/ca-certificates
15+ # If we ever need to bust the cache, just change the date here.
16+ RUN echo 'cachebuster 2025-10-17' && apt-get update
17+
18+ RUN apt-get install -y --no-install-recommends --no-install-suggests \
19+ fonts-ipaexfont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst-one fonts-freefont-ttf \
20+ libxss1 unifont fonts-open-sans fonts-roboto fonts-inter fonts-recommended \
21+ bash util-linux openssl tini ca-certificates locales libnss3-tools ca-certificates
22+
23+ ARG CHROMIUM_VERSION=141.0.7390.107
24+ RUN apt-get satisfy -y --no-install-recommends --no-install-suggests \
25+ "chromium (>=${CHROMIUM_VERSION}), chromium-driver (>=${CHROMIUM_VERSION}), chromium-shell (>=${CHROMIUM_VERSION}), chromium-sandbox (>=${CHROMIUM_VERSION})"
26+ RUN apt-get clean && rm -rf /var/lib/apt/lists/*
5327
54- USER root
55- SHELL ["/bin/busybox" , "sh" , "-c" ]
56- RUN /bin/busybox --install
57- # Verify that the browser was actually installed.
58- RUN /usr/bin/chromium --version
5928# This is so the browser can write file names that contain non-ASCII characters.
6029RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen en_US.UTF-8
6130RUN fc-cache -fr
6231RUN update-ca-certificates --fresh
63- USER nonroot
6432
65- ENV CHROME_BIN= "/usr/bin/chromium"
66- ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD= "true"
67- ENV NODE_ENV=production
68- ENV LANG=en_US.UTF-8
69- ENV LC_ALL=en_US.UTF-8
33+ USER root
34+ RUN useradd --create-home --system --uid 65532 --user-group nonroot
35+ RUN chgrp -R 0 /home/nonroot && chmod -R g=u /home/nonroot
36+ WORKDIR /home/nonroot
37+ USER 65532
7038
7139COPY --from=build /src/node_modules node_modules
7240COPY --from=build /src/build build
7341COPY --from=build /src/proto proto
7442COPY --from=build /src/default.json config.json
7543COPY --from=build /src/plugin.json plugin.json
7644
77- USER root
78-
79- RUN chgrp -R 0 /home/nonroot && chmod -R g=u /home/nonroot
80-
81- USER 65532
82-
8345EXPOSE 8081
8446
85- ENTRYPOINT ["tini" , "--" , "/nodejs/bin/node" ]
47+ ENV CHROME_BIN="/usr/bin/chromium"
48+ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
49+ ENV NODE_ENV=production
50+ ENV LANG=en_US.UTF-8
51+ ENV LC_ALL=en_US.UTF-8
52+ ENTRYPOINT ["tini" , "--" , "node" ]
8653CMD ["build/app.js" , "server" , "--config=config.json" ]
8754HEALTHCHECK --interval=10s --retries=3 --timeout=3s \
8855 CMD ["wget" , "-O-" , "-q" , "http://localhost:8081/" ]
0 commit comments