forked from bastilimbach/docker-MagicMirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_aarch64
78 lines (71 loc) · 2.38 KB
/
Dockerfile_aarch64
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 DOCKERFILE IS OPTIMIZED TO Raspberry pi 4 and Raspbian ARM64 (aarch64) platform
FROM node:16-buster-slim
LABEL maintainer="cslev <cslev@gmx.com>"
#ARG branch=master
ENV DEPS git \
gettext \
net-tools \
# ethtool \
# dnsutils \
nano \
ca-certificates \
bash \
iputils-ping \
sudo \
git \
iproute2 \
wget
ENV BUILD_DEPS make \
gcc \
automake-1.15 \
automake \
libc6-dev
#ENV NODE_ENV production
COPY sources /tmp/
WORKDIR /opt/magic_mirror
#COPY source/mm-docker-config.js source/docker-entrypoint.sh ./
RUN set -e; \
#installing deps
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y;\
DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y;\
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $DEPS;\
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends $BUILD_DEPS;\
#lol_dht22 is needed for aarch64, pure wiringpi+dht_var do not work
# The commands below are for reference, it is compiled and binary attached to reduce resource usage
cd /tmp/;\
git clone https://github.com/guation/WiringPi-arm64.git; \
cd WiringPi-arm64/; \
./build;\
cd ..;\
git clone https://github.com/technion/lol_dht22; \
cd lol_dht22;\
./configure;\
make;\
cd /opt/magic_mirror;\
#install MM
git clone https://github.com/MichMich/MagicMirror.git . ;\
cp -R modules /opt/default_modules;\
cp -R config /opt/default_config;\
cp -R css /opt/default_css;\
cp -R js /opt/default_js;\
npm install --unsafe-perm;\
npm install simple-git;\
npm install request;\
npm install nodehelper;\
cp /tmp/mm-docker-config.js ./config/config.js;\
chmod +x /tmp/docker-entrypoint.sh;\
cp /tmp/docker-entrypoint.sh ./;\
#load custom bashrc that contains coloring and shortened install commands
mv /tmp/bashrc_template /root/.bashrc; \
#. /root/.bashrc; \
#cleaning
#DEBIAN_FRONTEND=noninteractive apt-get remove -y $BUILD_DEPS; \
#DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y;\
apt-get clean;\
rm -rf /var/lib/apt/lists/*;
EXPOSE 8080
ENTRYPOINT ["./docker-entrypoint.sh"]
#run node server, i.e., run MM
#CMD ["bash"]
CMD ["node", "serveronly"]