-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
51 lines (46 loc) · 1.51 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ARG RUBY_VERSION="3.3.1"
ARG IMAGE_NAME="ruby:${RUBY_VERSION}-slim"
# hadolint ignore=DL3006
FROM ${IMAGE_NAME}
LABEL maintainer="Moritz Heiber <[email protected]>"
LABEL org.opencontainers.image.source=https://github.com/moritzheiber/ruby-jemalloc-docker
ARG RUBY_VERSION
ARG RUBY_CHECKSUM="8dc2af2802cc700cd182d5430726388ccf885b3f0a14fcd6a0f21ff249c9aa99"
ARG ADDITIONAL_FLAGS
ENV DEBIAN_FRONTEND="noninteractive" \
RUBY_VERSION="${RUBY_VERSION}"
WORKDIR /tmp/build
SHELL ["/bin/bash", "-o","pipefail", "-c"]
# hadolint ignore=DL3008,DL3003,SC1091
RUN apt-get update && \
apt-get install -y --no-install-recommends curl \
ca-certificates \
python3 \
apt-utils \
build-essential \
bison \
libyaml-dev \
libgdbm-dev \
libreadline-dev \
libjemalloc-dev \
libncurses5-dev \
libffi-dev \
zlib1g-dev \
libssl-dev && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain=1.77.0 && \
source "${HOME}/.cargo/env" && \
curl -L -o "ruby-${RUBY_VERSION}.tar.gz" "https://cache.ruby-lang.org/pub/ruby/${RUBY_VERSION%.*}/ruby-${RUBY_VERSION}.tar.gz" && \
echo "${RUBY_CHECKSUM} ruby-${RUBY_VERSION}.tar.gz" | sha256sum --strict -c - && \
tar xf "ruby-${RUBY_VERSION}.tar.gz" && \
cd "ruby-${RUBY_VERSION}" && \
./configure --prefix=/opt/ruby \
--with-jemalloc \
--enable-shared \
--disable-install-doc \
"${ADDITIONAL_FLAGS}" && \
make -j"$(nproc)" > /dev/null && \
make install && \
rustup self uninstall -y && \
rm -rf /tmp/build && \
apt-get clean
WORKDIR /