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

Add jemalloc support #198

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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
9 changes: 8 additions & 1 deletion 2.2/jessie/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ RUN set -ex \
libgdbm-dev \
ruby \
' \
&& runtimeDeps=' \
libjemalloc-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $buildDeps $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
Expand All @@ -51,6 +54,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -62,6 +66,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"
Copy link

Choose a reason for hiding this comment

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

maybe nice to leave this as a sanity check with RUN ruby -r rbconfig -e "abort 'jemalloc not enabled' unless RbConfig::CONFIG['LIBS'].include?('jemalloc')"


# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
5 changes: 5 additions & 0 deletions 2.2/jessie/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
libyaml-dev \
procps \
zlib1g-dev \
libjemalloc-dev \
&& rm -rf /var/lib/apt/lists/*

# skip installing gem documentation
Expand Down Expand Up @@ -74,6 +75,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -88,6 +90,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
9 changes: 8 additions & 1 deletion 2.3/jessie/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ RUN set -ex \
libgdbm-dev \
ruby \
' \
&& runtimeDeps=' \
libjemalloc-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $buildDeps $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
Expand All @@ -51,6 +54,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -62,6 +66,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
5 changes: 5 additions & 0 deletions 2.3/jessie/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
libyaml-dev \
procps \
zlib1g-dev \
libjemalloc-dev \
&& rm -rf /var/lib/apt/lists/*

# skip installing gem documentation
Expand Down Expand Up @@ -74,6 +75,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -88,6 +90,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
9 changes: 8 additions & 1 deletion 2.3/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ RUN set -ex \
libssl1.0-dev \
ruby \
' \
&& runtimeDeps=' \
libjemalloc-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $buildDeps $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
Expand All @@ -53,6 +56,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -64,6 +68,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
5 changes: 5 additions & 0 deletions 2.3/stretch/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
libyaml-dev \
procps \
zlib1g-dev \
libjemalloc-dev \
&& rm -rf /var/lib/apt/lists/*

# skip installing gem documentation
Expand Down Expand Up @@ -74,6 +75,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -88,6 +90,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
9 changes: 8 additions & 1 deletion 2.4/jessie/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ RUN set -ex \
libgdbm-dev \
ruby \
' \
&& runtimeDeps=' \
libjemalloc-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $buildDeps $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
Expand All @@ -51,6 +54,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -62,6 +66,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
5 changes: 5 additions & 0 deletions 2.4/jessie/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
libyaml-dev \
procps \
zlib1g-dev \
libjemalloc-dev \
&& rm -rf /var/lib/apt/lists/*

# skip installing gem documentation
Expand Down Expand Up @@ -74,6 +75,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -88,6 +90,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
9 changes: 8 additions & 1 deletion 2.4/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ RUN set -ex \
libgdbm-dev \
ruby \
' \
&& runtimeDeps=' \
libjemalloc-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $buildDeps $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
Expand All @@ -51,6 +54,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -62,6 +66,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
5 changes: 5 additions & 0 deletions 2.4/stretch/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
libyaml-dev \
procps \
zlib1g-dev \
libjemalloc-dev \
&& rm -rf /var/lib/apt/lists/*

# skip installing gem documentation
Expand Down Expand Up @@ -74,6 +75,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -88,6 +90,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
9 changes: 8 additions & 1 deletion 2.5/stretch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ RUN set -ex \
libgdbm-dev \
ruby \
' \
&& runtimeDeps=' \
libjemalloc-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $buildDeps $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
Expand All @@ -51,6 +54,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -62,6 +66,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
5 changes: 5 additions & 0 deletions 2.5/stretch/slim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
libyaml-dev \
procps \
zlib1g-dev \
libjemalloc-dev \
&& rm -rf /var/lib/apt/lists/*

# skip installing gem documentation
Expand Down Expand Up @@ -74,6 +75,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -88,6 +90,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
9 changes: 8 additions & 1 deletion Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ RUN set -ex \
libssl1.0-dev \
ruby \
' \
&& runtimeDeps=' \
libjemalloc-dev \
' \
Copy link
Author

Choose a reason for hiding this comment

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

I had to add it as a separate set of dependencies, because buildDeps get purged after the build is finished.

&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $buildDeps $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget -O ruby.tar.xz "https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz" \
Expand All @@ -53,6 +56,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -64,6 +68,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile-slim.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
libyaml-dev \
procps \
zlib1g-dev \
libjemalloc-dev \
&& rm -rf /var/lib/apt/lists/*

# skip installing gem documentation
Expand Down Expand Up @@ -74,6 +75,7 @@ RUN set -ex \
--build="$gnuArch" \
--disable-install-doc \
--enable-shared \
--with-jemalloc \
&& make -j "$(nproc)" \
&& make install \
\
Expand All @@ -88,6 +90,9 @@ RUN set -ex \
&& gem install bundler --version "$BUNDLER_VERSION" --force \
&& rm -r /root/.gem/

# TODO remove me before merging
RUN ruby -r rbconfig -e "RbConfig::CONFIG['LIBS'].include?('jemalloc') ? puts('Ruby is compiled with jemalloc') : warn('JEMALLOC IS MISSING FROM RUBY')"

# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
Expand Down