-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile.template
59 lines (49 loc) · 1.72 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
52
53
54
55
56
57
58
59
ARG ARCH=%%BALENA_ARCH%%
ARG REMOTE_TAG=v2.0.6
ARG VARIANT=std
# Builder image
FROM balenalib/${ARCH}-debian:bookworm-build AS builder
ARG ARCH
ARG REMOTE_TAG
ARG VARIANT
# Switch to working directory for our app
WORKDIR /app
# Checkout and compile remote code
COPY builder/build ./
COPY builder/patches ./patches
RUN chmod +x build
RUN ARCH=${ARCH} REMOTE_TAG=${REMOTE_TAG} VARIANT=${VARIANT} ./build
# Runner image
FROM balenalib/${ARCH}-debian:bookworm-run AS runner
ARG ARCH
ARG TAG
ARG VERSION
ARG BUILD_DATE
ARG REMOTE_TAG
ARG VARIANT
# Image metadata
LABEL maintainer="Xose Pérez <xose.perez@gmail.com>"
LABEL authors="Jose Marcelino, Marc Pous, Xose Pérez and Semtech"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="LoRaWAN Basics™ Station"
LABEL org.label-schema.description="LoRaWAN gateway with Basics™ Station Packet Forward protocol"
LABEL org.label-schema.vcs-type="Git"
LABEL org.label-schema.vcs-url="https://github.com/xoseperez/basicstation-docker"
LABEL org.label-schema.arch=${ARCH}
LABEL org.label-schema.license="BSD License 2.0"
LABEL io.balena.features.balena-api="1"
# Install required runtime packages
RUN install_packages jq vim gpiod socat
# Switch to working directory for our app
WORKDIR /app
# Copy fles from builder and repo
RUN mkdir ./artifacts
COPY --from=builder /app/basicstation/build-rpi-${VARIANT}/bin ./artifacts/v2
COPY --from=builder /app/basicstation/build-corecell-${VARIANT}/bin ./artifacts/corecell
COPY --from=builder /app/basicstation/build-linuxpico-${VARIANT}/bin ./artifacts/picocell
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"]