Skip to content

Commit

Permalink
Updated Dockerfile (#384)
Browse files Browse the repository at this point in the history
1. Changed base image to bullseye
2. The updated base image contains an updated version of libjemalloc too, so building from source is no longer necessary
3. Updated libvips version too
  • Loading branch information
ItalyPaleAle committed Feb 20, 2022
1 parent 5f473e5 commit 9489834
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
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 && \
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

0 comments on commit 9489834

Please sign in to comment.