diff options
author | Evan Read <eread@gitlab.com> | 2022-10-21 14:53:16 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2022-10-21 14:53:16 +0300 |
commit | 138c95ff982d0e5dae60a0eef1eb52361c514b59 (patch) | |
tree | 1383ee6622a30c45a438b6d687b539774b3ccc92 /latest.Dockerfile | |
parent | 7a4ec3e64a89964b4cc9df91ad831e7a7f8dd090 (diff) |
Use versioned base image for latest.Dockerfile and add test
Diffstat (limited to 'latest.Dockerfile')
-rw-r--r-- | latest.Dockerfile | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/latest.Dockerfile b/latest.Dockerfile index 63a7a6ed..8738fb07 100644 --- a/latest.Dockerfile +++ b/latest.Dockerfile @@ -1,42 +1,7 @@ -# -# This Dockerfile is mainly used to create the docs:latest image which includes -# the latest 3 stable versions plus the most recent one built from main. -# - -# First use the bootstrap image to build main -FROM registry.gitlab.com/gitlab-org/gitlab-docs:bootstrap as builder - -# Set up needed environment variables that are called with --build-arg when -# the Docker image is built (see .gitlab-ci.yml). -ARG NANOC_ENV -ARG CI_COMMIT_REF_NAME -# If CI_COMMIT_REF_NAME is not set (local development), set it to main -ENV CI_COMMIT_REF_NAME ${CI_COMMIT_REF_NAME:-main} - -# Build the docs from this branch -COPY . /source/ -RUN yarn install && \ - bundle install && \ - bundle exec rake default && \ - bundle exec nanoc compile -VV && \ - /scripts/compress_images.sh /source/public ee # compress images - -# Symlink EE to CE -# https://gitlab.com/gitlab-org/gitlab-docs/issues/418 -WORKDIR /source/public/ -RUN rm -rf ce && ln -s ee ce - -# BUILD OF 'main' DOCS IS NOW DONE! - -# Reset to alpine so we don't get any docs source or extra apps -FROM nginx:1.12-alpine +FROM nginx:1.23.1-alpine ENV TARGET=/usr/share/nginx/html -# Get the nginx config from the nginx-onbuild image -# This hardly ever changes so should usually be cached -COPY --from=registry.gitlab.com/gitlab-org/gitlab-docs:nginx-onbuild /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf - # Remove default Nginx HTML files RUN rm -rf /usr/share/nginx/html/* @@ -51,15 +16,3 @@ COPY --from=registry.gitlab.com/gitlab-org/gitlab-docs:15.2 ${TARGET} ${TARGET} COPY --from=registry.gitlab.com/gitlab-org/gitlab-docs:14.10 ${TARGET} ${TARGET} COPY --from=registry.gitlab.com/gitlab-org/gitlab-docs:13.12 ${TARGET} ${TARGET} -# Get the built docs output from the previous build stage -# This ordering means all previous layers can come from cache unless an archive -# changes -COPY --from=builder /source/public ${TARGET} - -# Since we changed images when we invoked 'FROM nginx:1.12-alpine' above, -# the minify script and binary are not included. Thus, we copy them from the -# previous image (aliased as builder). -COPY --from=builder /scripts/minify* /scripts/ - -# Serve the site (target), which is now all static HTML -CMD ["sh", "-c", "echo 'GitLab docs are viewable at: http://0.0.0.0:4000'; exec nginx -g 'daemon off;'"] |