mirror of
https://github.com/chirpstack/chirpstack.git
synced 2024-12-24 07:16:42 +00:00
31 lines
834 B
Docker
31 lines
834 B
Docker
# Copy binary stage
|
|
FROM --platform=$BUILDPLATFORM alpine:3.21.0 as binary
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
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
|
|
|
|
RUN case "$TARGETPLATFORM" in \
|
|
"linux/amd64") \
|
|
cp /usr/bin/chirpstack-x86_64 /usr/bin/chirpstack; \
|
|
;; \
|
|
"linux/arm/v7") \
|
|
cp /usr/bin/chirpstack-armv7hf /usr/bin/chirpstack; \
|
|
;; \
|
|
"linux/arm64") \
|
|
cp /usr/bin/chirpstack-aarch64 /usr/bin/chirpstack; \
|
|
;; \
|
|
esac;
|
|
|
|
# Final stage
|
|
FROM alpine:3.21.0
|
|
|
|
RUN apk --no-cache add \
|
|
ca-certificates
|
|
|
|
COPY --from=binary /usr/bin/chirpstack /usr/bin/chirpstack
|
|
USER nobody:nogroup
|
|
ENTRYPOINT ["/usr/bin/chirpstack"]
|