-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
65 lines (54 loc) · 1.34 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ubuntu:focal
ENV LANG=C.UTF-8 \
RUBY_VERSION=2.7.6 \
TZ=America/Los_Angeles \
DEBIAN_FRONTEND=noninteractive
RUN mkdir -p /.rbenv
ENV RBENV_ROOT=/.rbenv
# Dependencies for Ruby
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
python2 \
tzdata \
git \
curl \
libssl-dev \
libreadline-dev \
zlib1g-dev \
autoconf \
bison \
build-essential \
libyaml-dev \
libreadline-dev \
libncurses5-dev \
libffi-dev \
libgdbm-dev \
rbenv \
; \
rm -rf /var/lib/apt/lists/*;
# Install Ruby and configure rbenv
RUN mkdir -p "$(rbenv root)"/plugins
RUN git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
RUN rbenv install ${RUBY_VERSION}
RUN rbenv global ${RUBY_VERSION}
RUN echo 'eval "$(rbenv init -)"' >> ~/.bashrc
# Install Java 8
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
openjdk-8-jdk openjdk-8-jre \
fontconfig libfreetype6 \
ca-certificates p11-kit \
; \
rm -rf /var/lib/apt/lists/*;
# Pre-install most gems
WORKDIR gemfiles
COPY Gemfile* .
ENV BUNDLE_SILENCE_ROOT_WARNING=1
RUN eval "$(rbenv init -)" && bundle install
# Remove the Gemfiles we copied so that they don't cause confusion
WORKDIR /
RUN rm -rf /gemfiles
RUN cp ~/.bashrc .bashrc
CMD [ "/bin/bash" ]