33ARG GO_VERSION=1.23
44ARG DEBIAN_VERSION=bookworm
55ARG PROTOC_VERSION=3.11.4
6- ARG PROTOC_GOOGLEAPIS_VERSION=2af421884dd468d565137215c946ebe4e245ae26
76
87# protoc is dynamically linked to glibc so can't use alpine base
98
@@ -22,16 +21,6 @@ RUN <<EOT
2221 unzip protoc-${PROTOC_VERSION}-${TARGETOS}-${arch}.zip -d /opt/protoc
2322EOT
2423
25- FROM base AS googleapis
26- ARG PROTOC_GOOGLEAPIS_VERSION
27- RUN <<EOT
28- set -e
29- wget -q https://github.com/googleapis/googleapis/archive/${PROTOC_GOOGLEAPIS_VERSION}.zip -O googleapis.zip
30- unzip googleapis.zip '*.proto' -d /opt
31- mkdir -p /opt/googleapis
32- mv /opt/googleapis-${PROTOC_GOOGLEAPIS_VERSION} /opt/googleapis/include
33- EOT
34-
3524FROM base AS gobuild-base
3625WORKDIR /app
3726
@@ -41,10 +30,10 @@ RUN --mount=type=bind,source=go.mod,target=/app/go.mod \
4130 --mount=type=cache,target=/root/.cache \
4231 --mount=type=cache,target=/go/pkg/mod <<EOT
4332 set -e
44- mkdir -p /opt/vtprotobuf
33+ mkdir -p /opt/vtprotobuf/include/github.com/planetscale/vtprotobuf/vtproto
4534 go mod download github.com/planetscale/vtprotobuf
46- cp -R $(go list -m -f='{{.Dir}}' github.com/planetscale/vtprotobuf)/include /opt/vtprotobuf
47- chmod -R 0755 /opt/vtprotobuf
35+ cp $(go list -m -f='{{.Dir}}' github.com/planetscale/vtprotobuf)/include/github.com/planetscale/vtprotobuf/vtproto/ext.proto /opt/vtprotobuf/include/github.com/planetscale/vtprotobuf/vtproto/ext.proto
36+ chmod 0644 /opt/vtprotobuf/include/github.com/planetscale/vtprotobuf/vtproto/ext.proto
4837EOT
4938
5039FROM gobuild-base AS vendored
5645
5746FROM scratch AS protobuf
5847COPY --link --from=protoc /opt/protoc /
59- COPY --link --from=googleapis /opt/googleapis /
6048COPY --link --from=vtprotobuf /opt/vtprotobuf /
6149COPY --link --from=vendored /opt/vendored /
6250
0 commit comments