chirpstack/Dockerfile

31 lines
834 B
Docker
Raw Normal View History

# Copy binary stage
2024-12-06 09:54:54 +00:00
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
2022-04-06 20:18:32 +00:00
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
2024-12-06 09:54:54 +00:00
FROM alpine:3.21.0
2022-04-06 20:18:32 +00:00
RUN apk --no-cache add \
ca-certificates
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"]