github.com/google/fleetspeak@v0.1.15-0.20240426164851-4f31f62c1aea/sandboxes/shared/fleetspeak-client/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  RUN mkdir -p /app/bin
    32  
    33  RUN cd /fleetspeak && \
    34      python3 -m venv /venv/FSENV && \
    35      source /venv/FSENV/bin/activate && \
    36      pip install wheel pytest && \
    37      pip install -e ./fleetspeak_python[test] && \
    38      pip install -e ./frr_python && \
    39      ./fleetspeak/generate_go_py_protos.sh && \
    40      go build -o /app/bin/server ./cmd/fleetspeak_server && \
    41      go build -o /app/bin/client ./cmd/fleetspeak_client && \
    42      go build -o /app/bin/fleetspeak_config ./cmd/fleetspeak_config
    43