ttn-resin-gateway-rpi/Dockerfile.template
Jac Kersing 2922f63a85 Two stage build to reduce image size and build improvements provided by @imrehg.
Add (optional) metering support for use with Prometheus.
2018-02-12 18:32:11 +01:00

30 lines
790 B
Docker

FROM resin/%%RESIN_MACHINE_NAME%%-debian:latest AS buildstep
WORKDIR /opt/ttn-gateway/
# downloading utils
RUN apt-get update && \
apt-get install wget build-essential libc6-dev git pkg-config protobuf-compiler libprotobuf-dev libprotoc-dev automake libtool autoconf python-dev python-rpi.gpio
COPY dev dev
RUN ./dev/build.sh
FROM resin/%%RESIN_MACHINE_NAME%%-debian:latest
WORKDIR /opt/ttn-gateway
RUN apt-get update && \
apt-get install python-rpi.gpio && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=buildstep /opt/ttn-gateway/mp_pkt_fwd .
COPY --from=buildstep /usr/local/lib/libpaho-embed-* /usr/lib/
COPY --from=buildstep /usr/lib/libttn* /usr/lib/
COPY run.py ./
COPY start.sh ./
# run when container lands on device
CMD ["bash", "start.sh"]