This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
66 lines (50 loc) · 1.82 KB
/
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
ARG SYSTEM_TIMEZONE=Europe/London
####################################################################################################
################################## Stage: builder ##################################################
FROM balenalib/raspberry-pi-debian:buster-build as builder
# Copy build ARG
ARG SYSTEM_TIMEZONE
# Install dependencies
RUN \
apt-get update && \
DEBIAN_FRONTEND="noninteractive" \
TZ="$SYSTEM_TIMEZONE" \
apt-get -y install \
erlang-nox=1:21.2.6+dfsg-1 \
erlang-dev=1:21.2.6+dfsg-1 \
git=1:2.20.1-2+deb10u3 \
--no-install-recommends
# Change working directory and clone gateway_mfr repo
WORKDIR /opt/gateway_mfr
RUN git clone https://github.com/helium/gateway_mfr.git
# Change working directory
WORKDIR /opt/gateway_mfr/gateway_mfr
# Make gateway_mfr
RUN DEBUG=1 make release
# No need to cleanup the builder
####################################################################################################
################################### Stage: runner ##################################################
FROM balenalib/raspberry-pi-debian:buster-run
# Copy build ARG
ARG SYSTEM_TIMEZONE
# Install dependencies and clean up
RUN \
apt-get update && \
DEBIAN_FRONTEND="noninteractive" \
TZ="$SYSTEM_TIMEZONE" \
apt-get -y install \
erlang-nox=1:21.2.6+dfsg-1 \
python3-minimal=3.7.3-1 \
--no-install-recommends && \
apt-get autoremove -y &&\
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Change working directory
WORKDIR /opt/gateway_mfr
# Copy gateway_mfr from builder
COPY --from=builder /opt/gateway_mfr/gateway_mfr/_build/prod/rel/gateway_mfr .
# Copy scripts
COPY nebraScript.sh .
COPY eccProg.py .
# Run nebraScript.sh start script
ENTRYPOINT ["/opt/gateway_mfr/nebraScript.sh"]