2023-03-08 10:06:19 +01:00
|
|
|
FROM ubuntu:22.04@sha256:b2175cd4cfdd5cdb1740b0e6ec6bbb4ea4892801c0ad5101a81f694152b6c559 as build
|
2022-03-22 16:03:15 +01:00
|
|
|
|
2023-03-08 04:05:36 -05:00
|
|
|
ARG GO_VER=1.20.2
|
2022-10-21 13:15:24 +02:00
|
|
|
ARG GEN_GO_VER=1.28.1
|
2022-04-28 10:28:50 +02:00
|
|
|
ARG GEN_GO_GRPC_VER=1.2.0
|
2022-10-21 13:15:24 +02:00
|
|
|
ARG PB_VER=21.8
|
2022-03-22 16:03:15 +01:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND="noninteractive"
|
|
|
|
RUN apt-get update && apt-get install -y wget tar unzip
|
|
|
|
|
|
|
|
# Install Go
|
2022-09-02 12:45:56 +02:00
|
|
|
RUN wget -q https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz && \
|
2022-03-22 16:03:15 +01:00
|
|
|
tar -C /usr/local -xzf go${GO_VER}.linux-amd64.tar.gz && rm go${GO_VER}.linux-amd64.tar.gz
|
|
|
|
ENV PATH ${PATH}:/usr/local/go/bin:/root/go/bin
|
|
|
|
|
|
|
|
|
2022-09-02 12:45:56 +02:00
|
|
|
RUN wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${PB_VER}/protoc-${PB_VER}-linux-x86_64.zip && \
|
2022-03-22 16:03:15 +01:00
|
|
|
unzip protoc-${PB_VER}-linux-x86_64.zip -d /root/.local && \
|
|
|
|
cp /root/.local/bin/protoc /usr/local/bin/protoc
|
|
|
|
ENV PATH="$PATH:/root/.local/bin"
|
|
|
|
|
|
|
|
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GEN_GO_VER} && \
|
|
|
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v${GEN_GO_GRPC_VER}
|
|
|
|
|
|
|
|
# Generate code for every existing proto file
|
2022-04-12 14:24:36 +02:00
|
|
|
|
2022-09-08 14:45:27 +02:00
|
|
|
## disk-mapper recover api
|
2022-04-12 14:24:36 +02:00
|
|
|
WORKDIR /disk-mapper
|
2022-09-08 14:45:27 +02:00
|
|
|
COPY disk-mapper/recoverproto/*.proto /disk-mapper
|
2022-03-22 16:03:15 +01:00
|
|
|
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto
|
|
|
|
|
2022-04-12 14:24:36 +02:00
|
|
|
## debugd service
|
|
|
|
WORKDIR /service
|
|
|
|
COPY debugd/service/*.proto /service
|
|
|
|
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto
|
|
|
|
|
2022-05-10 12:35:17 +02:00
|
|
|
## key management
|
2023-01-11 10:08:57 +01:00
|
|
|
WORKDIR /keyservice
|
|
|
|
COPY keyservice/keyserviceproto/*.proto /keyservice
|
2022-05-10 12:35:17 +02:00
|
|
|
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto
|
|
|
|
|
2022-07-05 11:41:31 +02:00
|
|
|
## join service
|
|
|
|
WORKDIR /joinservice
|
|
|
|
COPY joinservice/joinproto/*.proto /joinservice
|
2022-05-23 11:36:54 +02:00
|
|
|
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto
|
2022-04-12 14:24:36 +02:00
|
|
|
|
2022-06-28 17:03:28 +02:00
|
|
|
## verify
|
|
|
|
WORKDIR /verify
|
|
|
|
COPY verify/verifyproto/*.proto /verify
|
2022-09-13 11:01:51 +02:00
|
|
|
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto
|
2022-06-21 17:59:12 +02:00
|
|
|
|
|
|
|
## init
|
|
|
|
WORKDIR /init
|
2022-06-29 15:26:29 +02:00
|
|
|
COPY bootstrapper/initproto/*.proto /init
|
2022-06-28 17:03:28 +02:00
|
|
|
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto
|
|
|
|
|
2022-12-25 18:49:45 +01:00
|
|
|
## upgrade agent
|
|
|
|
WORKDIR /upgrade-agent
|
|
|
|
COPY upgrade-agent/upgradeproto/*.proto /upgrade-agent
|
|
|
|
RUN protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative *.proto
|
|
|
|
|
2022-03-22 16:03:15 +01:00
|
|
|
FROM scratch as export
|
2022-09-08 14:45:27 +02:00
|
|
|
COPY --from=build /disk-mapper/*.go disk-mapper/recoverproto/
|
2022-04-12 14:24:36 +02:00
|
|
|
COPY --from=build /service/*.go debugd/service/
|
2023-01-11 10:08:57 +01:00
|
|
|
COPY --from=build /keyservice/*.go keyservice/keyserviceproto/
|
2022-07-05 11:41:31 +02:00
|
|
|
COPY --from=build /joinservice/*.go joinservice/joinproto/
|
2022-06-28 17:03:28 +02:00
|
|
|
COPY --from=build /verify/*.go verify/verifyproto/
|
2022-06-29 15:26:29 +02:00
|
|
|
COPY --from=build /init/*.go bootstrapper/initproto/
|
2022-12-25 18:49:45 +01:00
|
|
|
COPY --from=build /upgrade-agent/*.go upgrade-agent/upgradeproto/
|