forked from robbydyer/sports
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.pibuilder
48 lines (39 loc) · 1.34 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
# 2022-10-04 09:36
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.20.1
RUN apt-get update && \
apt-get install -y \
automake \
build-essential \
ca-certificates \
curl \
gcc \
git \
g++ \
rsync
RUN update-ca-certificates -f
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
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
RUN mkdir -p /src/internal/rgbmatrix-rpi/lib /src/web
COPY ./web /src/web
RUN cd /src/web && \
npm install
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://golang.org/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 ./internal/rgbmatrix-rpi/lib/rpi-rgb-led-matrix.BASE /sportsmatrix_lib/rpi-rgb-led-matrix
RUN cd /sportsmatrix_lib/rpi-rgb-led-matrix && \
make