ARG BASE_IMAGE_TYPE=slim # -------------------------------------- # slim image # -------------------------------------- FROM ghcr.io/renovatebot/base-image:2.22.0@sha256:c78a2bcdc1d33a20152770334c8d3d269dae86da05b3427ed30d86fcba3fae58 AS slim-base # -------------------------------------- # full image # -------------------------------------- FROM ghcr.io/renovatebot/base-image:2.22.0-full@sha256:c0e00f7349f53d73366f82b69a6850b42a45c4acf7e69690719e37ab11b4d091 AS full-base # -------------------------------------- # build image # -------------------------------------- FROM slim-base as build WORKDIR /usr/local/renovate ENV CI=1 npm_config_modules_cache_max_age=0 COPY pnpm-lock.yaml ./ # only fetch deps from lockfile https://pnpm.io/cli/fetch RUN corepack pnpm fetch --prod COPY . ./ # install RUN set -ex; \ corepack pnpm install --prod --offline --ignore-scripts; \ true # test COPY tools/docker/bin/ /usr/local/bin/ RUN set -ex; \ renovate --version; \ renovate-config-validator; \ node -e "new require('re2')('.*').exec('test')"; \ true # -------------------------------------- # final image # -------------------------------------- FROM ${BASE_IMAGE_TYPE}-base LABEL name="renovate" LABEL org.opencontainers.image.source="https://github.com/renovatebot/renovate" \ org.opencontainers.image.url="https://renovatebot.com" \ org.opencontainers.image.licenses="AGPL-3.0-only" WORKDIR /usr/src/app COPY tools/docker/bin/ /usr/local/bin/ CMD ["renovate"] ARG RENOVATE_VERSION COPY --from=build --chown=root:root /usr/local/renovate/ /usr/local/renovate/ # Compabillity, so `config.js` can access renovate and deps RUN set -ex; \ mkdir /opt/containerbase/tools/renovate; \ echo "${RENOVATE_VERSION}" > /opt/containerbase/versions/renovate; \ ln -sf /usr/local/renovate /opt/containerbase/tools/renovate/${RENOVATE_VERSION}; \ ln -sf /usr/local/renovate/node_modules ./node_modules; \ true RUN set -ex; \ renovate --version; \ renovate-config-validator; \ node -e "new require('re2')('.*').exec('test')"; \ true LABEL \ org.opencontainers.image.version="${RENOVATE_VERSION}" \ org.label-schema.version="${RENOVATE_VERSION}" # Numeric user ID for the ubuntu user. Used to indicate a non-root user to OpenShift USER 1000