-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
69 lines (53 loc) · 2.04 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
67
68
69
#Packet Forwarder Docker File
#(C) Pi Supply 2019
#Licensed under the GNU GPL V3 License.
FROM debian:buster-slim AS buildstep
WORKDIR /opt/iotloragateway/packet_forwarder
RUN apt-get update && apt-get upgrade -y && apt-get -y install protobuf-compiler \
libprotobuf-dev \
libprotoc-dev \
automake \
libtool \
autoconf \
git \
pkg-config \
protobuf-c-compiler \
libprotobuf-c-dev \
build-essential \
libc6-dev
COPY buildfiles buildfiles
ARG moo=1
RUN chmod +x ./buildfiles/packetCompile.sh
RUN ./buildfiles/packetCompile.sh
FROM debian:buster-slim
WORKDIR /opt/iotloragateway/packet_forwarder
RUN apt-get update && apt-get upgrade -y && apt-get -y install libprotobuf-c1 python3-minimal python3-yaml --no-install-recommends && apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=buildstep /opt/iotloragateway/packetforwarder_hat .
COPY --from=buildstep /opt/iotloragateway/packetforwarder_sg0 .
COPY --from=buildstep /opt/iotloragateway/packetforwarder_sg1 .
COPY --from=buildstep /usr/local/lib/libpaho-embed-* /usr/lib/
COPY --from=buildstep /usr/lib/libttn* /usr/lib/
COPY lora_templates lora_templates/
RUN cp lora_templates/local_conf.json.template local_conf_HAT.json
RUN cp lora_templates/EU-global_conf.json global_conf_HAT.json
RUN cp lora_templates/local_conf.json.template local_conf_sg0.json
RUN cp lora_templates/EU-global_conf.json global_conf_sg0.json
RUN cp lora_templates/local_conf.json.template local_conf_sg1.json
RUN cp lora_templates/EU-global_conf.json global_conf_sg1.json
RUN chmod 777 ./local_conf_HAT.json
RUN chmod 777 ./local_conf_sg0.json
RUN chmod 777 ./local_conf_sg1.json
RUN chmod +x ./packetforwarder_hat
RUN chmod +x ./packetforwarder_sg0
RUN chmod +x ./packetforwarder_sg1
COPY files/run_pkt.sh .
COPY files/configurePktFwd.py .
COPY files/reset-pins.sh .
COPY files/reset-38.sh .
COPY files/reset-39.sh .
RUN chmod +x reset-pins.sh
RUN chmod +x reset-38.sh
RUN chmod +x reset-39.sh
RUN chmod +x run_pkt.sh
RUN chmod +x configurePktFwd.py
ENTRYPOINT ["sh", "/opt/iotloragateway/packet_forwarder/run_pkt.sh"]