Skip to content

Commit 859a8f5

Browse files
authored
Merge protoc generator dockerfile into generator.Dockerfile (#499)
1 parent 75fc786 commit 859a8f5

File tree

3 files changed

+24
-36
lines changed

3 files changed

+24
-36
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Build the autoinstrumenter binary
2-
# TODO: replace by OTEL image once they are uploaded
32
FROM ghcr.io/open-telemetry/obi-generator:0.1.1@sha256:3575058c6e7fa5346e62eef608f197802e8771f53bd2070e01751175c639c31d AS builder
43

54
# TODO: embed software version in executable

generator.Dockerfile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,35 @@ FROM base AS dist
1313
WORKDIR /src
1414

1515
ENV EBPF_VER=v0.19.0
16+
ENV PROTOC_VERSION=32.0
17+
ARG TARGETARCH
1618

17-
RUN apk add clang llvm20 wget
19+
RUN apk add clang llvm20 wget unzip curl
1820
RUN apk cache purge
21+
22+
# Install protoc
23+
# Deal with the arm64==aarch64 ambiguity
24+
RUN if [ "$TARGETARCH" = "arm64" ]; then \
25+
curl -qL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip -o protoc.zip; \
26+
else \
27+
curl -qL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip -o protoc.zip; \
28+
fi
29+
RUN unzip protoc.zip -d /usr/local
30+
RUN rm protoc.zip
31+
32+
# Install protoc-gen-go and protoc-gen-go-grpc
33+
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
34+
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
35+
36+
# Install eBPF tools
1937
RUN go install github.com/cilium/ebpf/cmd/bpf2go@$EBPF_VER
2038
COPY --from=builder /build/obi_genfiles /go/bin
2139

40+
# Verify installations
41+
RUN protoc --version
42+
RUN protoc-gen-go --version
43+
RUN protoc-gen-go-grpc --version
44+
2245
RUN cat <<EOF > /generate.sh
2346
#!/bin/sh
2447
export GOCACHE=/tmp

protoc.Dockerfile

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)