forked from OpenFogStack/celestial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.Dockerfile
78 lines (67 loc) · 2.67 KB
/
compile.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# This file is part of Celestial (https://github.com/OpenFogStack/celestial).
# Copyright (c) 2024 Tobias Pfandzelter, The OpenFogStack Team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
FROM debian:bookworm@sha256:b16cef8cbcb20935c0f052e37fc3d38dc92bfec0bcfb894c328547f81e932d67
ARG OS=linux
ARG ARCH=x86_64
ARG GO_ARCH=amd64
ARG LIBPROTOC_VERSION=25.1
ARG GO_VERSION=1.22.1
ARG PROTOC_GEN_GO_VERSION=1.31.0
ARG PROTOC_GEN_GO_GRPC_VERSION=1.3
RUN apt-get update && apt-get install -y \
--no-install-recommends \
--no-install-suggests \
ca-certificates \
wget \
make \
clang \
gcc-multilib \
libbpf-dev \
llvm \
build-essential \
unzip \
python3 \
git \
python3-pip \
python3-venv && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${LIBPROTOC_VERSION}/protoc-${LIBPROTOC_VERSION}-${OS}-${ARCH}.zip && \
unzip protoc-${LIBPROTOC_VERSION}-${OS}-${ARCH}.zip -d protoc-${LIBPROTOC_VERSION} && \
mv protoc-${LIBPROTOC_VERSION} /usr/local/protoc && \
rm protoc-${LIBPROTOC_VERSION}-${OS}-${ARCH}.zip && \
chmod +x /usr/local/protoc/bin/* && \
ln -s /usr/local/protoc/bin/protoc /usr/local/bin/protoc
RUN wget https://go.dev/dl/go${GO_VERSION}.${OS}-${GO_ARCH}.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go${GO_VERSION}.${OS}-${GO_ARCH}.tar.gz && \
echo 'export PATH="$PATH:/usr/local/go/bin"' >> /etc/profile && \
echo 'export PATH="$PATH:/root/go/bin"' >> /etc/profile && \
echo 'export GOPATH=/root/go' >> /etc/profile && \
echo 'export GOBIN="/root/go/bin"' >> /etc/profile && \
rm -rf go${GO_VERSION}.${OS}-${GO_ARCH}.tar.gz
ENV PATH $PATH:/usr/local/go/bin
ENV PATH $PATH:/root/go/bin
ENV GOPATH /root/go
ENV GOBIN /root/go/bin
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOC_GEN_GO_VERSION} && \
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v${PROTOC_GEN_GO_GRPC_VERSION}
RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"
COPY requirements.txt requirements.txt
RUN python3 -m pip install -r requirements.txt -U
WORKDIR /celestial
ENTRYPOINT [ "make" ]