-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile.template
51 lines (40 loc) · 1.53 KB
/
Dockerfile.template
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
ARG ARCH=%%BALENA_ARCH%%
# Builder image
FROM balenalib/${ARCH:-empty}-debian:bookworm-build AS builder
ARG ARCH
# Install required development packages
RUN install_packages libftdi-dev libusb-dev
# Switch to working directory for our app
WORKDIR /app
# Checkout and compile remote code
COPY ./builder/ ./
RUN chmod +x build
RUN ARCH=${ARCH} ./build
# Runner image
FROM balenalib/${ARCH:-empty}-debian:bookworm-run AS runner
ARG ARCH
# Image metadata
LABEL maintainer="RAKwireless"
LABEL authors="RAKwireless"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="UDP Packet Forwarder"
LABEL org.label-schema.description="LoRaWAN UDP Packet Forwarder"
LABEL org.label-schema.vcs-type="Git"
LABEL org.label-schema.vcs-url="https://github.com/RAKWireless/udp-packet-forwarder"
LABEL org.label-schema.license="BSD License 2.0"
# Install required runtime packages
RUN install_packages jq vim libftdi1 gpiod socat
# Switch to working directory for our app
WORKDIR /app
# Copy fles from builder and repo
COPY --from=builder /app/artifacts ./artifacts
COPY --from=builder /app/artifacts/v2/ftdi/99-libftdi.rules /etc/udev/rules.d/99-libftdi.rules
COPY --from=builder /usr/local/lib/libmpsse.so /usr/local/lib/libmpsse.so
COPY --from=builder /usr/local/lib/libmpsse.a /usr/local/lib/libmpsse.a
COPY --from=builder /usr/local/include/mpsse.h /usr/local/include/mpsse.h
COPY ./runner/ ./
RUN chmod +x start gateway_eui find_concentrator
# Add application folder to path
ENV PATH="${PATH}:/app"
# Launch our binary on container startup.
CMD ["start"]