Skip to content

Commit d99f960

Browse files
committed
Fix dockerized proto build
Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
1 parent 9623748 commit d99f960

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ check-protoc:
193193
fi
194194

195195
install-protoc install-protobuf:
196-
$(Q)PROTOBUF_VERSION=$(PROTOBUF_VERSION) ./scripts/install-protobuf
196+
$(Q)PROTOBUF_VERSION=$(PROTOBUF_VERSION) INSTALL_DIR=$(PROTOC_PATH) ./scripts/install-protobuf
197197

198198
clean-protoc:
199199
$(Q)rm -rf $(PROTOC_PATH)

hack/Dockerfile.buildproto

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@ WORKDIR /go/src
2323
RUN apt-get update && apt-get install -y unzip
2424

2525
RUN --mount=type=cache,target=/go/pkg/mod/ \
26-
--mount=src=.,target=. \
27-
make install-protoc-dependencies install-ttrpc-plugin install-wasm-plugin install-protoc
28-
29-
RUN --mount=type=cache,target=/go/pkg/mod/ \
26+
--mount=type=cache,target=/go/tools/,sharing=private \
3027
--mount=src=.,target=.,rw=true \
31-
make build-proto && \
28+
make build-proto PROTOC_PATH=/go/tools/protoc && \
3229
tar czf /artifacts.tgz ${ARTIFACTS}
3330

3431
FROM scratch AS final

scripts/install-protobuf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PROTOBUF_VERSION=${PROTOBUF_VERSION-3.20.1}
2424
GOARCH=$(go env GOARCH)
2525
GOOS=$(go env GOOS)
2626
PROTOBUF_DIR=$(mktemp -d)
27-
INSTALL_DIR="$PWD/build/tools/protoc"
27+
INSTALL_DIR=${INSTALL_DIR-"$PWD/build/tools/protoc"}
2828

2929
mkdir -p "$INSTALL_DIR"
3030

0 commit comments

Comments
 (0)