blob: 5ff65568daf1f10255b247ff63598c96557e1f16 (
plain)
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
|
############################
#
# Image the contains the dependencies to run the lints.
# It downloads the gitlab-docs repository based on the
# branch the Docker image is invoked from.
# Based on Alpine.
#
############################
FROM registry.gitlab.com/gitlab-org/gitlab-docs:base
MAINTAINER GitLab Documentation Team
# Install vale
# We need to build it from source, see https://github.com/errata-ai/vale/issues/128
# VALE_VERSION and MARKDOWNLINT_VERSION are defined in .gitlab-ci.yml
ARG VALE_VERSION
ARG MARKDOWNLINT_VERSION
ENV GOBIN=/usr/local/bin
RUN apk add --no-cache wget zip tar make && \
wget https://github.com/errata-ai/vale/archive/v${VALE_VERSION}.tar.gz && \
tar -xvzf v${VALE_VERSION}.tar.gz && \
cd vale-${VALE_VERSION} && \
make && \
make install && \
cd .. && \
rm -r vale-${VALE_VERSION} && \
rm v${VALE_VERSION}.tar.gz && \
# Remove the /usr/lib/go directory, we no longer need it after Vale is built,
# and it cleans up more than 200MB of space.
rm -rf /usr/lib/go
# Set up needed environment variables that are called with --build-arg when
# the Docker image is built (see .gitlab-ci.yml).
ARG CI_COMMIT_REF_NAME
# If CI_COMMIT_REF_NAME is not set (local development), set it to master
ENV CI_COMMIT_REF_NAME ${CI_COMMIT_REF_NAME:-master}
WORKDIR /tmp
# markdownlint-cli pinned to control when new versions are put in place.
RUN yarn global add markdownlint-cli@${MARKDOWNLINT_VERSION} && yarn cache clean
RUN wget https://gitlab.com/gitlab-org/gitlab-docs/-/archive/$CI_COMMIT_REF_NAME/gitlab-docs-$CI_COMMIT_REF_NAME.tar.bz2 \
&& tar xvjf gitlab-docs-$CI_COMMIT_REF_NAME.tar.bz2 \
&& mv gitlab-docs-$CI_COMMIT_REF_NAME gitlab-docs \
&& rm gitlab-docs-$CI_COMMIT_REF_NAME.tar.bz2
RUN cd gitlab-docs \
&& yarn install --frozen-lockfile \
&& NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install --jobs 4
|