From 774ed4f3df9f1c67b146e6e6f4563c8c49dd13e2 Mon Sep 17 00:00:00 2001 From: Matt Critchlow Date: Thu, 24 Aug 2023 07:01:44 -0700 Subject: [PATCH] Update Dockerfile to use Ruby 3.22, Alpine 3.18 This also affords dropping the manual installation of jemalloc, as in Alpine 3.18 the desired version is in the package repository. https://pkgs.alpinelinux.org/package/v3.18/main/x86_64/jemalloc --- Dockerfile | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 19ce618e4c..92b05de5df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,10 @@ -ARG RUBY_VERSION=3.2.1 +ARG ALPINE_VERSION=3.18 +ARG RUBY_VERSION=3.2.2 -# Replace with official jemalloc package in alpine 3.17 -FROM ruby:$RUBY_VERSION-alpine3.16 as builder -RUN apk add build-base curl -RUN curl -sL https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \ - cd jemalloc-5.3.0 && \ - ./configure && \ - make && \ - make install +FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as builder +RUN apk add build-base curl jemalloc -FROM ruby:$RUBY_VERSION-alpine3.16 as hyrax-base +FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION as hyrax-base ARG DATABASE_APK_PACKAGE="postgresql-dev" ARG EXTRA_APK_PACKAGES="git" @@ -43,7 +38,7 @@ ENV PATH="/app/samvera:$PATH" ENV RAILS_ROOT="/app/samvera/hyrax-webapp" ENV RAILS_SERVE_STATIC_FILES="1" -COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/ +COPY --from=builder /usr/lib/libjemalloc.so.2 /usr/local/lib/ ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" ENTRYPOINT ["hyrax-entrypoint.sh"]