|
3 | 3 | # THE TAG IN update-dev-tag.sh AND RUN IT # |
4 | 4 | #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!# |
5 | 5 |
|
| 6 | +# dart's protoc plugin does not publish pre-builds, |
| 7 | +# so we have to build it ourselves |
| 8 | +# This builder will produce the statically linked binary |
| 9 | +# /build/protoc_plugin/bin/protoc_plugin |
| 10 | + |
| 11 | +# based on debian 12 (bookworm-slim) |
| 12 | +FROM dart:3.6.0-sdk AS dart-builder |
| 13 | + |
| 14 | +WORKDIR /build |
| 15 | + |
| 16 | +# TODO: renovate |
| 17 | +ENV DART_PROTOC_PLUGIN_VERSION=21.1.2 |
| 18 | +RUN curl -fsSL https://github.com/google/protobuf.dart/archive/refs/tags/protoc_plugin-v${DART_PROTOC_PLUGIN_VERSION}.tar.gz | \ |
| 19 | + tar -xz --strip-components=1 \ |
| 20 | + && cd protoc_plugin \ |
| 21 | + && dart pub get \ |
| 22 | + && dart compile exe bin/protoc_plugin.dart \ |
| 23 | + && rm /build/* -rf |
| 24 | + |
| 25 | + |
6 | 26 | # based on the debian 12 ("bookworm") go image |
7 | 27 | # for now this only builds x86_64 images (TODO) |
8 | 28 | FROM golang:1.23-bookworm |
@@ -53,6 +73,24 @@ RUN wget https://github.com/authzed/zed/releases/download/v${ZED_VERSION}/zed_${ |
53 | 73 | && apt install -y ./zed.deb \ |
54 | 74 | && rm zed.deb |
55 | 75 |
|
| 76 | + |
| 77 | +# install javascript proto plugin and grpc-web codegen |
| 78 | +# https://github.com/protocolbuffers/protobuf-javascript/ |
| 79 | +# TODO: renovate |
| 80 | +ENV PROTOC_JS_VERSION=3.21.4 |
| 81 | +RUN wget -qO- https://github.com/protocolbuffers/protobuf-javascript/releases/download/v${PROTOC_JS_VERSION}/protobuf-javascript-${PROTOC_JS_VERSION}-linux-x86_64.tar.gz \ |
| 82 | + | tar -xz --strip-components=1 -C /usr/local/bin bin/protoc-gen-js |
| 83 | + |
| 84 | +# TODO: renovate |
| 85 | +ENV PROTOC_WEB_VERSION=1.5.0 |
| 86 | +RUN wget -q https://github.com/grpc/grpc-web/releases/download/${PROTOC_WEB_VERSION}/protoc-gen-grpc-web-${PROTOC_WEB_VERSION}-linux-x86_64 \ |
| 87 | + -O /usr/local/bin/protoc-gen-grpc-web \ |
| 88 | + && chmod +x /usr/local/bin/protoc-gen-grpc-web |
| 89 | + |
| 90 | +# install dart protoc plugin |
| 91 | +COPY --from=dart-builder /build/protoc_plugin/bin/protoc_plugin.exe /usr/local/bin/protoc-gen-dart |
| 92 | + |
| 93 | + |
56 | 94 | # clean up apt artifacts, |
57 | 95 | # dont use apt after this line |
58 | 96 | RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* |
@@ -124,21 +162,13 @@ ENV GO_INJECT_TAG_VERSION=1.4.0 |
124 | 162 | RUN go install github.com/favadi/protoc-go-inject-tag@v${GO_INJECT_TAG_VERSION} \ |
125 | 163 | && go clean -modcache |
126 | 164 |
|
127 | | - |
| 165 | +# install go proto plugin and grpc codegen |
| 166 | +# https://protobuf.dev/getting-started/gotutorial/ |
128 | 167 | # TODO: renovate |
129 | 168 | RUN go install google.golang.org/protobuf/cmd/ [email protected] |
130 | 169 | RUN go install google.golang.org/grpc/cmd/ [email protected] |
131 | 170 | ENV PATH="$PATH:$(go env GOPATH)/bin" |
132 | 171 |
|
133 | | -# TODO: renovate |
134 | | -ENV PROTOC_JS_VERSION=3.21.4 |
135 | | -RUN wget -qO- https://github.com/protocolbuffers/protobuf-javascript/releases/download/v${PROTOC_JS_VERSION}/protobuf-javascript-${PROTOC_JS_VERSION}-linux-x86_64.tar.gz \ |
136 | | - | tar -xz --strip-components=1 -C /usr/local/bin bin/protoc-gen-js |
137 | | - |
138 | | -ENV PROTOC_WEB_VERSION=1.5.0 |
139 | | -RUN wget -q https://github.com/grpc/grpc-web/releases/download/${PROTOC_WEB_VERSION}/protoc-gen-grpc-web-${PROTOC_WEB_VERSION}-linux-x86_64 \ |
140 | | - -O /usr/local/bin/protoc-gen-grpc-web |
141 | | - |
142 | 172 | # install gofumpt, a stricter gofmt |
143 | 173 | # https://github.com/mvdan/gofumpt |
144 | 174 | # renovate: datasource=github-releases depName=mvdan/gofumpt |
|
0 commit comments