-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile.pibuilder
67 lines (56 loc) · 2.21 KB
/
Dockerfile.pibuilder
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
# 2025-02-26 16:16
ARG BASE=multiarch/debian-debootstrap:arm64-bullseye-slim
FROM $BASE
# Replace shell with bash so we can source files
SHELL ["/bin/bash", "--login", "-ce"]
ARG GOVERSION=1.24.1
ARG PROTOC_VER=30.0
RUN apt-get update --allow-unauthenticated --allow-insecure-repositories && \
apt-get install --allow-unauthenticated -y debian-archive-keyring && \
apt-get clean
RUN apt-get update && \
apt-get install -y \
automake \
build-essential \
ca-certificates \
curl \
gcc \
g++ \
unzip
ENV PB_REL="https://github.com/protocolbuffers/protobuf/releases"
RUN a="$(dpkg --print-architecture)" && \
case "${a##*-}" in \
arm64|aarch64) \
arch="aarch_64" && \
curl -LO "$PB_REL/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-${arch}.zip" && \
unzip protoc-${PROTOC_VER}-linux-${arch}.zip -d /usr/local && \
protoc --version \
;; \
amd64) \
arch="x86_64" && \
curl -LO "$PB_REL/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-${arch}.zip" && \
unzip protoc-${PROTOC_VER}-linux-${arch}.zip -d /usr/local && \
protoc --version \
;; \
esac
RUN update-ca-certificates -f
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
RUN GOIMG= && a="$(dpkg --print-architecture)" && \
case "${a##*-}" in \
arm64|aarch64) GOIMG="go${GOVERSION}.linux-arm64.tar.gz";; \
amd64) GOIMG="go${GOVERSION}.linux-amd64.tar.gz";; \
armv7l|armv6l|armhf) GOIMG="go${GOVERSION}.linux-armv6l.tar.gz";; \
*) echo "unsupported arch ${a}"; exit 1 ;;\
esac && \
curl -k -L https://go.dev/dl/${GOIMG} -o /tmp/${GOIMG} && \
tar -C /usr/local -xzf /tmp/${GOIMG} && \
/usr/local/go/bin/go version
ENV PATH="/usr/local/go/bin:${PATH}"
COPY .nvmrc /root/.nvmrc
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
RUN cd /root && nvm install && nvm install 18.16.0 && nvm install 20.11.0
COPY ./internal/rgbmatrix-rpi/lib/rpi-rgb-led-matrix.BASE /sportsmatrix_lib/rpi-rgb-led-matrix
RUN cd /sportsmatrix_lib/rpi-rgb-led-matrix && \
make
RUN apt-get remove -y curl && \
apt-get autoremove -y && apt-get clean