2023-05-03 21:00:30 +08:00
|
|
|
FROM golang:1.20.4-alpine3.17 as go
|
2023-04-15 18:56:14 +08:00
|
|
|
RUN set -ex; \
|
|
|
|
apk add --no-cache \
|
2023-04-06 21:05:59 +08:00
|
|
|
vips-dev \
|
2023-04-15 22:47:16 +08:00
|
|
|
vips-magick \
|
|
|
|
vips-heif \
|
2023-04-15 22:48:49 +08:00
|
|
|
vips-jxl \
|
2023-04-15 23:00:21 +08:00
|
|
|
vips-poppler \
|
2023-04-06 21:05:59 +08:00
|
|
|
build-base; \
|
2023-05-12 18:50:10 +08:00
|
|
|
go install github.com/h2non/imaginary@b632dae8cc321452c3f85bcae79c580b1ae1ed84;
|
2022-08-25 21:06:23 +08:00
|
|
|
|
2023-04-06 21:05:59 +08:00
|
|
|
FROM alpine:3.17.3
|
2023-04-15 18:56:14 +08:00
|
|
|
RUN set -ex; \
|
|
|
|
apk add --no-cache \
|
2023-04-06 21:05:59 +08:00
|
|
|
tzdata \
|
|
|
|
ca-certificates \
|
|
|
|
netcat-openbsd \
|
2023-04-15 22:47:16 +08:00
|
|
|
vips \
|
|
|
|
vips-magick \
|
|
|
|
vips-heif \
|
2023-04-15 23:00:21 +08:00
|
|
|
vips-jxl \
|
|
|
|
vips-poppler
|
2022-08-25 21:06:23 +08:00
|
|
|
|
2023-04-06 21:05:59 +08:00
|
|
|
COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary
|
2023-03-08 18:08:03 +08:00
|
|
|
|
2023-04-15 22:35:05 +08:00
|
|
|
USER nobody
|
|
|
|
|
2023-03-08 18:08:03 +08:00
|
|
|
# https://github.com/h2non/imaginary#memory-issues
|
|
|
|
ENV MALLOC_ARENA_MAX=2
|
2023-04-10 23:20:04 +08:00
|
|
|
ENTRYPOINT ["imaginary", "-p", "9000", "-return-size", "-max-allowed-resolution", "222.2"]
|
2023-04-06 21:05:59 +08:00
|
|
|
|
|
|
|
HEALTHCHECK CMD nc -z localhost 9000 || exit 1
|
|
|
|
LABEL com.centurylinklabs.watchtower.monitor-only="true"
|