2024-01-01 01:43:35 +01:00
|
|
|
FROM golang:1.21-alpine3.19 AS builder
|
2023-02-10 22:47:58 +01:00
|
|
|
|
2024-01-15 15:14:54 +01:00
|
|
|
ARG BUILD_VERSION
|
2023-02-10 22:47:58 +01:00
|
|
|
|
2024-01-15 15:14:54 +01:00
|
|
|
WORKDIR /app
|
2023-02-10 22:47:58 +01:00
|
|
|
|
2024-01-15 15:14:54 +01:00
|
|
|
COPY src src
|
2023-02-10 22:47:58 +01:00
|
|
|
|
2024-01-15 15:14:54 +01:00
|
|
|
RUN cd src && \
|
|
|
|
if [ -n "${BUILD_VERSION}" ]; then \
|
|
|
|
go build -o /go/bin/immich-exporter -ldflags="-X 'main.Version=${BUILD_VERSION}'" . ; \
|
|
|
|
else \
|
|
|
|
go build -o /go/bin/immich-exporter . ; \
|
|
|
|
fi
|
2023-06-21 23:29:41 +02:00
|
|
|
|
2024-01-01 01:43:35 +01:00
|
|
|
FROM alpine:3.19
|
2023-02-10 22:47:58 +01:00
|
|
|
|
|
|
|
COPY --from=builder /go/bin/immich-exporter /go/bin/immich-exporter
|
|
|
|
|
2023-02-13 18:18:09 +01:00
|
|
|
WORKDIR /go/bin
|
2023-06-21 23:29:41 +02:00
|
|
|
|
2024-01-15 15:14:54 +01:00
|
|
|
CMD ["/go/bin/immich-exporter"]
|