forked from murrayres/bashir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.new
115 lines (98 loc) · 2.93 KB
/
Dockerfile.new
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
FROM selenium/node-chrome:3.4.0-dysprosium
LABEL authors=SeleniumHQ
USER root
#COPY entry_point.sh /opt/bin/entry_point.sh
EXPOSE 4444
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
build-essential \
curl \
imagemagick \
libbz2-dev \
libcurl4-openssl-dev \
libevent-dev \
libffi-dev \
libglib2.0-dev \
libjpeg-dev \
libmagickcore-dev \
libmagickwand-dev \
libmysqlclient-dev \
libncurses-dev \
libpq-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
libyaml-dev \
zlib1g-dev \
unzip \
bison \
libgdm-dev \
postgresql-client \
nodejs \
ruby \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# skip installing gem documentation
RUN mkdir -p /usr/local/etc \
&& { \
echo 'install: --no-document'; \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc
ARG RUBY_MAJOR="2.4"
ARG RUBY_VERSION="2.4.1"
ARG RUBY_SHA256="a330e10d5cb5e53b3a0078326c5731888bb55e32c4abfeb27d9e7f8e5d000250"
ARG RUBYGEMS_VERSION="2.6.4"
ARG BUNDLER_VERSION="1.15.0"
ENV RUBY_MAJOR ${RUBY_MAJOR}
ENV RUBY_VERSION ${RUBY_VERSION}
ENV RUBY_SHA256 ${RUBY_SHA256}
ENV RUBYGEMS_VERSION ${RUBYGEMS_VERSION}
ENV BUNDLER_VERSION ${BUNDLER_VERSION}
# some of ruby's build scripts are written in ruby
# we purge this later to make sure our final image uses what we just built
RUN set -ex \
&& curl -fsSL -o ruby.tar.gz "http://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz" \
&& echo "$RUBY_SHA256 ruby.tar.gz" | sha256sum -c - \
&& mkdir -p /usr/src/ruby \
&& tar -xzf ruby.tar.gz -C /usr/src/ruby --strip-components=1 \
&& rm ruby.tar.gz \
&& cd /usr/src/ruby \
&& { echo '#define ENABLE_PATH_CHECK 0'; echo; cat file.c; } > file.c.new && mv file.c.new file.c \
&& autoconf \
&& ./configure --disable-install-doc \
&& make -j"$(nproc)" \
&& make install \
&& apt-get purge -y --auto-remove $buildDeps \
&& gem update --system $RUBYGEMS_VERSION \
&& rm -r /usr/src/ruby
#RUN gem install bundler --version "$BUNDLER_VERSION"
RUN gem install bundler
# install things globally, for great justice
# and don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
ENV BUNDLE_PATH="$GEM_HOME" \
BUNDLE_BIN="$GEM_HOME/bin" \
BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME"
ENV PATH $BUNDLE_BIN:$PATH
RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
&& chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
WORKDIR /app
USER root
RUN bundle config --global frozen 1
# Bundle the gems in a separate directory, so that Docker
# can cache the results and only re-bundle gems if the
# Gemfile or Gemfile.lock files change.
RUN mkdir -p /gems
WORKDIR /gems
ADD Gemfile Gemfile
ADD Gemfile.lock Gemfile.lock
RUN bundle install
# Install the application
ENV APP_DIR /app
RUN mkdir -p ${APP_DIR}
WORKDIR ${APP_DIR}
ADD . ${APP_DIR}
CMD ./startui.sh