Last active
December 4, 2023 20:17
-
-
Save suntong/53d1c692bf46e96f267c02261a468c6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From extracted imaginary_base to imaginary, the working image | |
FROM imaginary_base | |
ARG PORT=9000 | |
RUN ls -l /usr/local/lib /usr/local/bin/imaginary /usr/local/bin/vips* | |
# Install libvips required libraries (again) + cjk fonts | |
RUN DEBIAN_FRONTEND=noninteractive \ | |
apt-get update && \ | |
apt-get install --no-install-recommends -y locales \ | |
fonts-noto-color-emoji fonts-noto-mono fonts-noto-cjk \ | |
libarchive-dev \ | |
glib-2.0-dev \ | |
libexpat1-dev \ | |
libpango1.0-dev \ | |
librsvg2-dev \ | |
libwebp-dev \ | |
libtiff5-dev \ | |
libexif-dev \ | |
liblcms2-dev \ | |
liborc-0.4-dev \ | |
libimagequant-dev \ | |
libpoppler-glib-dev \ | |
libcgif-dev \ | |
libheif-dev \ | |
libfftw3-dev && \ | |
apt-get autoremove -y && \ | |
apt-get autoclean && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
RUN echo en_US ISO-8859-1 en_US.UTF-8 UTF-8 zh_CN GB2312 zh_CN.GB18030 GB18030 zh_CN.UTF-8 UTF-8 | \ | |
xargs -n 2 | tee -a /etc/locale.gen && locale-gen && locale -a | |
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" | |
# Server port to listen | |
ENV PORT ${PORT} | |
# Drop privileges for non-UID mapped environments | |
USER nobody | |
# Run the entrypoint command by default when the container starts. | |
ENTRYPOINT ["/usr/local/bin/imaginary"] | |
# Expose the server TCP port | |
EXPOSE ${PORT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From imaginary_full (which is built from Dockerfile.new) to imaginary_base | |
FROM imaginary_full as builder | |
RUN ls -l /usr/local/lib /go/bin/imaginary /usr/local/bin/vips* | |
FROM debian:bookworm-slim | |
COPY --from=builder /usr/local/lib /usr/local/lib | |
COPY --from=builder /go/bin/imaginary /usr/local/bin/imaginary | |
COPY --from=builder /usr/local/bin/vips* /usr/local/bin | |
COPY --from=builder /etc/ssl/certs /etc/ssl/certs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment