forked from elastic/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
93 lines (86 loc) · 2.35 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
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
# Debian builds the docs about 20% faster than alpine. The image is larger
# and takes longer to build but that is worth it.
FROM bitnami/minideb:stretch
LABEL MAINTAINERS="Nik Everett <nik@elastic.co>"
# Setup repos for things like node and yarn
RUN install_packages apt-transport-https gnupg2 ca-certificates
COPY .docker/apt/sources.list.d/* /etc/apt/sources.list.d/
COPY .docker/apt/keys/* /
RUN cat /nodesource.gpg | apt-key add - && rm /nodesource.gpg
RUN cat /yarn.gpg | apt-key add - && rm yarn.gpg
# Package inventory:
# * To make life easier
# * bash
# * less
# * Used by the docs build
# * libnss-wrapper
# * libxml2-utils
# * nginx
# * openssh-client (used by git)
# * openssh-server (used to forward ssh auth for git when running with --all on macOS)
# * perl-base
# * python (is python2)
# * xsltproc
# * To install rubygems for asciidoctor
# * build-essential
# * cmake
# * libxml2-dev
# * make
# * ruby
# * ruby-dev
# * Used to check the docs build in CI
# * python3
# * python3-pip
# * Used to check javascript
# * nodejs
# * yarn
RUN install_packages \
bash \
build-essential \
curl \
cmake \
git \
less \
libnss-wrapper \
libxml2-dev \
libxml2-utils \
make \
nodejs \
nginx \
openssh-client \
openssh-server \
perl-base \
python \
python3 \
python3-pip \
ruby \
ruby-dev \
unzip \
yarn \
xsltproc
# We mount these directories with tmpfs so we can write to them so they
# have to be empty. So we delete them.
RUN rm -rf /var/log/nginx && rm -rf /run/nginx
# Wheel inventory:
# * Used to test the docs build
# * beautifulsoup4
# * lxml
# * pycodestyle
RUN pip3 install \
beautifulsoup4==4.7.1 \
lxml==4.3.1 \
pycodestyle==2.5.0
# Install ruby deps with bundler to make things more standard for Ruby folks.
RUN gem install bundler:2.0.1
RUN bundle config --global silence_root_warning 1
COPY Gemfile* /
RUN bundle install --binstubs --system --frozen
# --frozen forces us to regenerate Gemfile.lock locally before using it in
# docker which is important because we need Gemfile.lock to lock the gems to a
# consistent version and we can't rely on running bundler in docker to update
# it because we can't copy from the image to the host machine while building
# the image.
COPY package.json /
COPY yarn.lock /
ENV YARN_CACHE_FOLDER=/tmp/.yarn-cache
RUN yarn install --frozen-lockfile