gitlab-build-images/Dockerfile.omnibus-gitlab-jammy
2022-09-28 15:28:44 +10:00

40 lines
1.4 KiB
Docker

FROM ubuntu:22.04
RUN apt-get update -q \
&& apt-get install -y g++ gcc git make curl zlib1g-dev libssl-dev locales \
&& apt-get autoremove -yq \
&& apt-get clean -yqq \
&& rm -rf /var/lib/apt/lists/*
ENV LANG C.UTF-8
ENV LANGUAGE C
ENV LC_ALL C.UTF-8
ENV RUBY_VERSION 2.7.5
# Ruby 2.7.x and 3.0.x can not build against OpenSSL 3.0 which is the
# version with Ubuntu 22.04. This workaround installs OpenSSL 1.1.1q
# from source and builds.
#
# For further details see:
# - https://bugs.ruby-lang.org/issues/18658
# - https://github.com/rbenv/ruby-build/pull/1974
RUN curl -fsSL "https://www.openssl.org/source/openssl-1.1.1q.tar.gz" | tar -xzC /tmp \
&& cd /tmp/openssl-1.1.1q \
&& ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/openssl-1.1.1q /usr/local/openssl/certs \
&& ln -s /etc/ssl/certs /usr/local/openssl/
RUN curl -fsSL "https://cache.ruby-lang.org/pub/ruby/2.7/ruby-${RUBY_VERSION}.tar.gz" \
| tar -xzC /tmp \
&& cd "/tmp/ruby-${RUBY_VERSION}" \
&& ./configure --disable-install-rdoc --disable-install-doc --disable-install-capi --with-openssl-dir=/usr/local/openssl \
&& make \
&& make install \
&& cd / \
&& rm -rf "/tmp/ruby-${RUBY_VERSION}" \
&& gem install bundler --no-document --version 2.2.33