-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
39 lines (33 loc) · 1.59 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
ARG DEBIAN_IMAGE
FROM debian:${DEBIAN_IMAGE}
ARG RUBY_VERSION
ARG RUBY_VARIANT
ARG DEBIAN_VERSION
# RUN with pipe recommendation: https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update -q \
&& apt-get dist-upgrade --assume-yes \
&& apt-get install --assume-yes -q --no-install-recommends \
curl \
gnupg \
apt-transport-https \
ca-certificates \
&& curl -SLf https://raw.githubusercontent.com/fullstaq-labs/fullstaq-ruby-server-edition/main/fullstaq-ruby.asc | apt-key add - \
&& echo "deb https://apt.fullstaqruby.org debian-${DEBIAN_VERSION} main" > /etc/apt/sources.list.d/fullstaq-ruby.list \
&& apt-get update -q \
&& apt-get install --assume-yes -q --no-install-recommends fullstaq-ruby-${RUBY_VERSION}-${RUBY_VARIANT} \
&& apt-get autoremove --assume-yes \
&& rm -rf /var/lib/apt/lists \
&& rm -fr /var/cache/apt \
&& rm /etc/apt/sources.list.d/fullstaq-ruby.list
ENV GEM_HOME /usr/local/bundle
ENV BUNDLE_PATH="$GEM_HOME" \
BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME" \
RUBY_VERSION=${RUBY_VERSION}-${RUBY_VARIANT} \
LANG=C.UTF-8 LC_ALL=C.UTF-8
# path recommendation: https://github.com/bundler/bundler/pull/6469#issuecomment-383235438
ENV PATH $GEM_HOME/bin:$BUNDLE_PATH/gems/bin:/usr/lib/fullstaq-ruby/versions/${RUBY_VERSION}/bin:$PATH
# Make login shell (bash -l) to have the same path as regular one.
RUN echo 'PATH=$GEM_HOME/bin:$BUNDLE_PATH/gems/bin:/usr/lib/fullstaq-ruby/versions/${RUBY_VERSION}/bin:$PATH' >> /etc/profile.d/fullstaq-ruby.sh
CMD [ "irb" ]