Skip to content

Commit 3d69a3b

Browse files
Separate download/install phases in a couple Dockerfiles
We don't necessarily need to merge _this_ PR, but just wanted to see if we were missing any places here where we could split up these steps for better layering. Found a couple places. We can also just keep these updates in mind for the next fetcher updates.
1 parent c957032 commit 3d69a3b

5 files changed

Lines changed: 8 additions & 0 deletions

File tree

plugins/bufbuild/connect-swift-mocks/v0.7.0/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FROM swift:5.8.1-focal AS build
44
WORKDIR /app
55
RUN git clone --depth 1 --branch 0.7.0 https://github.com/bufbuild/connect-swift
66
WORKDIR /app/connect-swift
7+
RUN swift package resolve
78
RUN swift build -c release --product protoc-gen-connect-swift-mocks --static-swift-stdlib -Xlinker -s
89

910
FROM gcr.io/distroless/cc-debian11

plugins/bufbuild/connect-swift/v0.7.0/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FROM swift:5.8.1-focal AS build
44
WORKDIR /app
55
RUN git clone --depth 1 --branch 0.7.0 https://github.com/bufbuild/connect-swift
66
WORKDIR /app/connect-swift
7+
RUN swift package resolve
78
RUN swift build -c release --product protoc-gen-connect-swift --static-swift-stdlib -Xlinker -s
89

910
FROM gcr.io/distroless/cc-debian11

plugins/community/roadrunner-server-php-grpc/v5.3.0/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ ARG TARGETOS TARGETARCH
55
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
66

77
RUN git clone --depth=1 --branch v5.3.0 https://github.com/roadrunner-server/grpc.git
8+
RUN --mount=type=cache,target=/go/pkg/mod \
9+
cd grpc/protoc_plugins/protoc-gen-php-grpc \
10+
&& go mod download
811
RUN --mount=type=cache,target=/go/pkg/mod \
912
cd grpc/protoc_plugins/protoc-gen-php-grpc \
1013
&& go install -ldflags="-s -w" -trimpath \

plugins/grpc/go/v1.6.1/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ WORKDIR /tmp/grpc-go
1010
COPY separate-package.patch /tmp/grpc-go
1111
RUN git apply separate-package.patch
1212
WORKDIR /tmp/grpc-go/cmd/protoc-gen-go-grpc
13+
RUN --mount=type=cache,target=/go/pkg/mod \
14+
go mod download
1315
RUN --mount=type=cache,target=/go/pkg/mod \
1416
go build -o protoc-gen-go-grpc -ldflags "-s -w" -trimpath
1517

plugins/grpc/swift-protobuf/v2.2.1/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ WORKDIR /app
77
RUN git clone --depth 1 --branch 2.2.1 https://github.com/grpc/grpc-swift-protobuf --recursive
88
WORKDIR /app/grpc-swift-protobuf
99
COPY --link Package.resolved .
10+
RUN swift package resolve --force-resolved-versions
1011
RUN swift build -c release --static-swift-stdlib --product protoc-gen-grpc-swift-2 -Xlinker -s --force-resolved-versions
1112

1213
FROM gcr.io/distroless/cc-debian12:latest@sha256:329e54034ce498f9c6b345044e8f530c6691f99e94a92446f68c0adf9baa8464 AS base

0 commit comments

Comments
 (0)