Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions pre_commit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# syntax=docker.io/docker/dockerfile:1.20
FROM docker.io/library/golang:1.25.0-bookworm AS go

FROM ghcr.io/dependabot/dependabot-updater-core
# Import pre-built ecosystem images to avoid code duplication
# These images contain all the native helpers and tools already built
ARG GO_MODULES_BASE=ghcr.io/dependabot/dependabot-updater-gomod:latest
ARG BUNDLER_BASE=ghcr.io/dependabot/dependabot-updater-bundler:latest
ARG CORE_BASE=ghcr.io/dependabot/dependabot-updater-core:latest

FROM ${GO_MODULES_BASE} AS go_modules
FROM ${BUNDLER_BASE} AS bundler
FROM ${CORE_BASE}

USER root

COPY --from=go /usr/local/go /opt/go
# Copy Go installation and helpers from go_modules image
COPY --from=go_modules /opt/go /opt/go
COPY --from=go_modules /opt/go_modules /opt/go_modules
ENV PATH=/opt/go/bin:$PATH

ENV DEPENDABOT_NATIVE_HELPERS_PATH="/opt"

COPY go_modules/helpers /opt/go_modules/helpers
RUN bash /opt/go_modules/helpers/build
# Copy bundler helpers from bundler image (for Ruby additional_dependencies support)
COPY --from=bundler --chown=dependabot:dependabot /opt/bundler /opt/bundler

USER dependabot

# Install bundler native helpers for Ruby additional_dependencies support
COPY --chown=dependabot:dependabot bundler/helpers /opt/bundler/helpers
RUN bash /opt/bundler/helpers/v2/build

COPY --chown=dependabot:dependabot --parents go_modules cargo npm_and_yarn python pre_commit common bundler $DEPENDABOT_HOME/
COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater
Loading