Skip to content

Commit c6db387

Browse files
Update dockerfile to import images of dependent ecosystems
1 parent 3329651 commit c6db387

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

pre_commit/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
# syntax=docker.io/docker/dockerfile:1.20
2-
FROM docker.io/library/golang:1.25.0-bookworm AS go
2+
3+
# Import pre-built ecosystem images to avoid code duplication
4+
# These images contain all the native helpers and tools already built
5+
FROM ghcr.io/dependabot/dependabot-updater-gomod AS go_modules
6+
FROM ghcr.io/dependabot/dependabot-updater-bundler AS bundler
37

48
FROM ghcr.io/dependabot/dependabot-updater-core
59

610
USER root
711

8-
COPY --from=go /usr/local/go /opt/go
12+
# Copy Go installation and helpers from go_modules image
13+
COPY --from=go_modules /opt/go /opt/go
14+
COPY --from=go_modules /opt/go_modules /opt/go_modules
915
ENV PATH=/opt/go/bin:$PATH
1016

1117
ENV DEPENDABOT_NATIVE_HELPERS_PATH="/opt"
1218

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

1622
USER dependabot
1723

18-
# Install bundler native helpers for Ruby additional_dependencies support
19-
COPY --chown=dependabot:dependabot bundler/helpers /opt/bundler/helpers
20-
RUN bash /opt/bundler/helpers/v2/build
21-
2224
COPY --chown=dependabot:dependabot --parents go_modules cargo npm_and_yarn python pre_commit common bundler $DEPENDABOT_HOME/
2325
COPY --chown=dependabot:dependabot updater $DEPENDABOT_HOME/dependabot-updater

0 commit comments

Comments
 (0)