Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Amirault <mamirault@gitlab.com>2022-06-23 10:02:57 +0300
committerMarcel Amirault <mamirault@gitlab.com>2022-06-23 10:02:57 +0300
commitaddd6825356dd2f21642fd9f1b97fe4c8d923c8c (patch)
tree8661411737c98fe9ca8fa006d9d318a2b8d64607
parentd611f84e96a384066882d9b6cfe02bfb5c386c3f (diff)
parent7e967dbe231326b8127276b8661d92123f9a32ed (diff)
Merge branch 'revert-6d1db196' into 'main'
Revert "Merge branch 'eread/update-...-image' into 'main'" See merge request gitlab-org/gitlab-docs!2852
-rw-r--r--.gitlab/ci/docker-images.gitlab-ci.yml18
-rw-r--r--latest.Dockerfile23
2 files changed, 6 insertions, 35 deletions
diff --git a/.gitlab/ci/docker-images.gitlab-ci.yml b/.gitlab/ci/docker-images.gitlab-ci.yml
index 7b9214c1..9263b7d5 100644
--- a/.gitlab/ci/docker-images.gitlab-ci.yml
+++ b/.gitlab/ci/docker-images.gitlab-ci.yml
@@ -269,21 +269,3 @@ image:docs-latest:
script:
- docker build --build-arg NANOC_ENV=${NANOC_ENV} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} -t $IMAGE_NAME -f $DOCKERFILE .
- docker push $IMAGE_NAME
-
-#
-# Test the GitLab docs single version Docker image if changes made to its Dockerfile
-#
-test:image:docs-latest:
- extends:
- - .docker_prepare
- stage: test
- variables:
- IMAGE_NAME: $CI_REGISTRY_IMAGE:latest
- DOCKERFILE: latest.Dockerfile
- needs: []
- rules:
- - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- changes:
- - $DOCKERFILE
- script:
- - docker build --build-arg NANOC_ENV=${NANOC_ENV} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} -t $IMAGE_NAME -f $DOCKERFILE .
diff --git a/latest.Dockerfile b/latest.Dockerfile
index 98cfba58..e565ee7e 100644
--- a/latest.Dockerfile
+++ b/latest.Dockerfile
@@ -4,7 +4,7 @@
#
# First use the bootstrap image to build main
-FROM registry.gitlab.com/gitlab-org/gitlab-docs/base:alpine-3.16-ruby-2.7.6-0bc327a4 as builder
+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).
@@ -15,16 +15,11 @@ ENV CI_COMMIT_REF_NAME ${CI_COMMIT_REF_NAME:-main}
# Build the docs from this branch
COPY . /source/
-# Copy only the Gemfiles and yarn.lock to install the dependencies
-COPY /Gemfile* /source/
-COPY /yarn.lock /source/
-WORKDIR /source
-
RUN yarn install && \
bundle install && \
bundle exec rake setup_git default && \
bundle exec nanoc compile -VV && \
- scripts/compress_images.sh public ee # compress images
+ /scripts/compress_images.sh /source/public ee # compress images
# Symlink EE to CE
# https://gitlab.com/gitlab-org/gitlab-docs/issues/418
@@ -61,16 +56,10 @@ COPY --from=registry.gitlab.com/gitlab-org/gitlab-docs:13.12 ${TARGET} ${TARGET}
# changes
COPY --from=builder /source/public ${TARGET}
-# Build minifier utility
-# Adapted from https://github.com/docker/docker.github.io/blob/publish-tools/Dockerfile.builder
-#
-FROM golang:1.13-alpine AS minifier
-RUN apk add --no-cache git
-RUN export GO111MODULE=on \
- && go get -d github.com/tdewolff/minify/v2@latest \
- && go build -v -o /minify github.com/tdewolff/minify/cmd/minify
-WORKDIR /source
-COPY /scripts/minify* scripts/
+# 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;'"]