This commit is contained in:
Alexis Svinartchouk 2020-07-20 18:29:36 +02:00
parent a09187e3e5
commit 86fb91ec9d
3 changed files with 20 additions and 1 deletions

View File

@ -36,6 +36,7 @@ COPY --from=builder /usr/src/clicklock/clicklock /usr/bin/clicklock
# Etcher configuration script
COPY update-config-and-start.js /usr/src/app/
COPY zram.sh /usr/src/app/
COPY --from=builder /usr/src/app/dist/linux-arm64-unpacked/resources/app /usr/src/app
COPY --from=builder /usr/src/app/node_modules/electron/ /usr/src/app/node_modules/electron
@ -43,4 +44,11 @@ WORKDIR /usr/src/app/node_modules/.bin
RUN ln -s ../electron/cli.js electron
WORKDIR /usr/src/app
CMD node /usr/src/app/update-config-and-start.js
RUN \
apt-get update \
&& apt-get install -y kmod \
&& rm -rf /var/lib/apt/lists/*
CMD \
./zram.sh \
&& node /usr/src/app/update-config-and-start.js

View File

@ -14,6 +14,7 @@ services:
labels:
io.balena.features.dbus: 1
io.balena.features.supervisor-api: 1
io.balena.features.kernel-modules: 1
volumes:
- 'etcher_pki:/root/.pki'
- 'etcher_cache:/root/.cache'

10
zram.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
DEVICE=/dev/zram0
if [ ! -b $DEVICE ]; then
modprobe zram
zramctl $DEVICE --size 1024M
mkswap $DEVICE
swapon $DEVICE
fi