forked from elastic/apm-agent-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
43 lines (32 loc) · 1019 Bytes
/
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
ARG RUBY_IMAGE
FROM ${RUBY_IMAGE}
ARG USER_ID_GROUP
ARG FRAMEWORKS
ARG VENDOR_PATH
ARG BUNDLER_VERSION
# For tzdata
# ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -qq -y --no-install-recommends \
build-essential libpq-dev git \
&& rm -rf /var/lib/apt/lists/*
# Configure bundler and PATH
ENV LANG=C.UTF-8
ENV GEM_HOME=$VENDOR_PATH
ENV BUNDLE_PATH=$GEM_HOME \
BUNDLE_JOBS=4 BUNDLE_RETRY=3
ENV BUNDLE_APP_CONFIG=$BUNDLE_PATH \
BUNDLE_BIN=$BUNDLE_PATH/bin
ENV PATH=/app/bin:$BUNDLE_BIN:$PATH
ENV FRAMEWORKS $FRAMEWORKS
RUN mkdir -p $VENDOR_PATH \
&& chown -R $USER_ID_GROUP $VENDOR_PATH
USER $USER_ID_GROUP
# Upgrade RubyGems and install required Bundler version
RUN gem update --system && \
gem install bundler:$BUNDLER_VERSION
# Use unpatched, system version for more speed over less security
RUN gem install nokogiri -- --use-system-libraries
# Rake is required to build http-parser on some jruby images
RUN gem install rake
WORKDIR /app