Skip to content

Commit

Permalink
Update Dockerfile to use Ruby 3.22, Alpine 3.18
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mcritchlow committed Aug 24, 2023
1 parent 4d3ddb9 commit 585b1eb
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 585b1eb

Please sign in to comment.