github.com/google/fleetspeak@v0.1.15-0.20240426164851-4f31f62c1aea/sandboxes/shared/fleetspeak-server/Dockerfile (about) 1 # Copyright 2023 Google LLC 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 FROM golang:1.22 as builder 15 16 RUN apt update && \ 17 apt install -y python3-venv && \ 18 apt install -y pip && \ 19 apt install -y git 20 21 WORKDIR / 22 23 SHELL ["/bin/bash", "-c"] 24 25 RUN git clone https://github.com/google/fleetspeak.git && \ 26 cd fleetspeak && \ 27 go get -u golang.org/x/lint/golint && \ 28 go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.0 && \ 29 go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 30 31 ENV GOBIN=/fleetspeak-bin 32 33 RUN mkdir -p ${GOBIN} 34 35 RUN cd /fleetspeak && \ 36 python3 -m venv $HOME/.venv/FSENV && \ 37 source $HOME/.venv/FSENV/bin/activate && \ 38 pip install wheel pytest && \ 39 pip install -e ./fleetspeak_python[test] && \ 40 pip install -e ./frr_python && \ 41 ./fleetspeak/generate_go_py_protos.sh && \ 42 go install ./cmd/fleetspeak_server ./cmd/fleetspeak_client \ 43 ./cmd/fleetspeak_config 44 45 FROM golang:1.22 46 47 RUN mkdir -p /app/bin 48 49 COPY --from=builder /fleetspeak-bin/fleetspeak_server /app/bin/server 50 COPY --from=builder /fleetspeak-bin/fleetspeak_client /app/bin/client 51 COPY --from=builder /fleetspeak-bin/fleetspeak_config /app/bin/