2023-05-29 13:41:30 +00:00
|
|
|
# Copy binary stage
|
2024-12-06 09:54:54 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM alpine:3.21.0 as binary
|
2022-07-21 10:00:47 +00:00
|
|
|
|
|
|
|
ARG TARGETPLATFORM
|
2022-05-02 14:10:24 +00:00
|
|
|
|
2023-05-29 13:41:30 +00:00
|
|
|
COPY target/x86_64-unknown-linux-musl/release/chirpstack /usr/bin/chirpstack-x86_64
|
|
|
|
COPY target/armv7-unknown-linux-musleabihf/release/chirpstack /usr/bin/chirpstack-armv7hf
|
|
|
|
COPY target/aarch64-unknown-linux-musl/release/chirpstack /usr/bin/chirpstack-aarch64
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2022-07-21 10:00:47 +00:00
|
|
|
RUN case "$TARGETPLATFORM" in \
|
|
|
|
"linux/amd64") \
|
2023-05-29 13:41:30 +00:00
|
|
|
cp /usr/bin/chirpstack-x86_64 /usr/bin/chirpstack; \
|
2022-07-21 10:00:47 +00:00
|
|
|
;; \
|
|
|
|
"linux/arm/v7") \
|
2023-05-29 13:41:30 +00:00
|
|
|
cp /usr/bin/chirpstack-armv7hf /usr/bin/chirpstack; \
|
2022-07-21 10:00:47 +00:00
|
|
|
;; \
|
|
|
|
"linux/arm64") \
|
2023-05-29 13:41:30 +00:00
|
|
|
cp /usr/bin/chirpstack-aarch64 /usr/bin/chirpstack; \
|
2022-07-21 10:00:47 +00:00
|
|
|
;; \
|
|
|
|
esac;
|
|
|
|
|
|
|
|
# Final stage
|
2024-12-06 09:54:54 +00:00
|
|
|
FROM alpine:3.21.0
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-29 13:41:30 +00:00
|
|
|
RUN apk --no-cache add \
|
|
|
|
ca-certificates
|
2022-07-21 10:00:47 +00:00
|
|
|
|
2023-05-29 13:41:30 +00:00
|
|
|
COPY --from=binary /usr/bin/chirpstack /usr/bin/chirpstack
|
2022-04-06 20:18:32 +00:00
|
|
|
USER nobody:nogroup
|
2024-12-06 09:54:54 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/chirpstack"]
|