-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
41 lines (36 loc) · 1.11 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
FROM socrata/base-bionic
MAINTAINER Socrata <[email protected]>
# skip installing gem documentation
RUN mkdir -p /usr/local/etc \
&& { \
echo 'install: --no-document'; \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc
ENV RUBY_MAJOR 3.1
# some of ruby's build scripts are written in ruby
# we purge system ruby later to make sure our final image uses what we just built
RUN set -ex \
\
&& buildDeps=' \
libssl-dev \
libreadline-dev \
zlib1g-dev \
git \
'\
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
\
&& git clone https://github.com/rbenv/ruby-build.git /tmp/ruby-build \
\
&& PREFIX=/usr/local /tmp/ruby-build/install.sh \
\
&& ruby-build $(ruby-build -l | grep "^${RUBY_MAJOR}\.") /usr/local/ \
&& rm -r /tmp/ruby-build/ \
\
&& if [ -n "$BUNDLER_VERSION" ] ; then \
gem install bundler:$BUNDLER_VERSION ;\
fi
COPY ruby-version.rb /usr/local/bin/ruby-version.rb
# LABEL must be last for proper base image discoverability
LABEL repository.socrata/ruby3.1.x=""