-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile-node
60 lines (53 loc) · 1.66 KB
/
Dockerfile-node
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
ARG NODE_VERSION=18
FROM node:${NODE_VERSION}-alpine3.20
LABEL maintainer="Beth Skurrie <[email protected]>"
ENV NOKOGIRI_USE_SYSTEM_LIBRARIES=1
ENV BUNDLE_SILENCE_ROOT_WARNING=1
ADD docker/gemrc /root/.gemrc
ADD docker/pact /usr/local/bin/pact
# Update from rubygems 2.7.6 to 3.0.3 for security reasons
# Verify with gem -v
# TODO: Remove this when it is no longer needed
# For some reason this line changes the image size from 60 to 80 MB?!?
RUN apk update \
&& apk add ruby \
ruby-bundler \
ruby-io-console \
ca-certificates \
libressl \
less \
git \
&& apk add --virtual build-dependencies \
build-base \
ruby-dev \
libressl-dev \
ruby-rdoc \
\
&& gem install bundler -v "~>2.5" \
&& bundler -v \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle config git.allow_insecure true \
&& gem update --system 3.5.20 \
&& gem install json -v "~>2.3" \
&& gem install bigdecimal -v "~>3.1" \
&& gem install racc -v "~>1.8" \
&& gem uninstall rubygems-update \
&& gem cleanup \
&& rm -rf /usr/lib/ruby/gems/*/cache/* \
/var/cache/apk/* \
/tmp/* \
/var/tmp/*
ENV HOME=/pact
ENV DOCKER=true
ENV BUNDLE_GEMFILE=$HOME/Gemfile
WORKDIR $HOME
ADD pact-cli.gemspec .
ADD Gemfile .
ADD Gemfile.lock .
ADD lib/pact/cli/version.rb ./lib/pact/cli/version.rb
RUN bundle install --without test development --deployment true \
&& find /usr/lib/ruby/gems/3.3.0/gems -name Gemfile.lock -maxdepth 2 -delete
ADD docker/entrypoint.sh $HOME/entrypoint.sh
ADD bin ./bin
ADD lib ./lib
ENTRYPOINT ["pact"]