Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Dockerfile to Bullseye and updated libvips #384

Merged
merged 1 commit into from
Feb 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
**/*~
.devcontainer
.github
.git
Dockerfile
docker-compose.yml
21 changes: 7 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG GOLANG_VERSION=1.17
FROM golang:${GOLANG_VERSION}-buster as builder
FROM golang:${GOLANG_VERSION}-bullseye as builder

ARG IMAGINARY_VERSION=dev
ARG LIBVIPS_VERSION=8.10.0
ARG LIBVIPS_VERSION=8.12.2
ARG GOLANGCILINT_VERSION=1.29.0

# Installs libvips + required libraries
Expand Down Expand Up @@ -59,7 +59,7 @@ RUN go build -a \
-ldflags="-s -w -h -X main.Version=${IMAGINARY_VERSION}" \
github.com/h2non/imaginary

FROM debian:buster-slim
FROM debian:bullseye-slim

ARG IMAGINARY_VERSION

Expand All @@ -78,22 +78,15 @@ COPY --from=builder /etc/ssl/certs /etc/ssl/certs
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get install --no-install-recommends -y \
procps libglib2.0-0 libjpeg62-turbo libpng16-16 libopenexr23 \
procps libglib2.0-0 libjpeg62-turbo libpng16-16 libopenexr25 \
libwebp6 libwebpmux3 libwebpdemux2 libtiff5 libgif7 libexif12 libxml2 libpoppler-glib8 \
libmagickwand-6.q16-6 libpango1.0-0 libmatio4 libopenslide0 \
libgsf-1-114 fftw3 liborc-0.4-0 librsvg2-2 libcfitsio7 libimagequant0 libheif1 && \
libmagickwand-6.q16-6 libpango1.0-0 libmatio11 libopenslide0 libjemalloc2 \
libgsf-1-114 fftw3 liborc-0.4-0 librsvg2-2 libcfitsio9 libimagequant0 libheif1 && \
ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About this: the library that is installed from the DEB package goes in a folder whose name is dependent on the architecture of the system (e.g. aarch64). This made it more complicated to set an ENV var in the container. So I thought it'd be easier to just keep a symlink to the same path where the library was installed (from source) earlier.

apt-get autoremove -y && \
apt-get autoclean && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ADD https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 /tmp/jemalloc-5.2.1.tar.bz2
RUN apt-get update && apt install -y bzip2 gcc make autoconf
RUN cd /tmp \
&& tar -jxvf jemalloc-5.2.1.tar.bz2 --no-same-owner \
&& cd jemalloc-5.2.1 \
&& ./configure --enable-prof && make && make install \
&& rm -rf /tmp/*
ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so

# Server port to listen
Expand Down