immich-exporter/Dockerfile

23 lines
445 B
Docker
Raw Normal View History

2024-01-01 01:43:35 +01:00
FROM golang:1.21-alpine3.19 AS builder
2024-01-15 15:14:54 +01:00
ARG BUILD_VERSION
2024-01-15 15:14:54 +01:00
WORKDIR /app
2024-01-15 15:14:54 +01:00
COPY src src
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
2024-01-01 01:43:35 +01:00
FROM alpine:3.19
COPY --from=builder /go/bin/immich-exporter /go/bin/immich-exporter
WORKDIR /go/bin
2024-01-15 15:14:54 +01:00
CMD ["/go/bin/immich-exporter"]