ARG BASE_TAG=master FROM registry.gitlab.com/gitlab-org/gitlab-development-kit/asdf-bootstrapped-verify:main@sha256:14fa752a80df21f840fc48f4be8561bee21b78886ac718652582fdd788d34c32 as gdk-base # Allow passwordless /etc/hosts update by gdk user USER root RUN echo "gdk ALL=(ALL) NOPASSWD: /usr/bin/tee -a /etc/hosts" >> /etc/sudoers USER gdk # Clone GDK and save gem cache location ENV GEM_CACHE_LOCATION=/home/gdk/.gem_cache ARG GDK_SHA=main RUN set -eux; \ git -c advice.detachedHead=false clone --depth 1 https://gitlab.com/gitlab-org/gitlab-development-kit.git; \ git -C gitlab-development-kit fetch --depth 1 origin ${GDK_SHA}; \ git -C gitlab-development-kit -c advice.detachedHead=false checkout ${GDK_SHA}; \ mkdir -p gitlab-development-kit/gitlab; \ cd gitlab-development-kit && make bootstrap; \ echo "$(gem env | awk '/- GEM PATHS:/ {flag=1; next} flag && /^[[:space:]]*- / {print $2; exit}')/cache" > ${GEM_CACHE_LOCATION} WORKDIR /home/gdk/gitlab-development-kit COPY --chown=gdk:gdk qa/gdk/gdk.yml ./ # Build gitaly # COPY --chown=gdk:gdk GITALY_SERVER_VERSION ./gitlab/ RUN set -eux; \ make gitaly-setup; \ rm -rf gitaly/_build/cache \ gitaly/_build/deps/git/source \ gitaly/_build/deps/libgit2/source \ gitaly/_build/deps \ gitaly/_build/intermediate \ $(cat $GEM_CACHE_LOCATION) \ && go clean -cache # Build gitlab-shell # COPY --chown=gdk:gdk GITLAB_SHELL_VERSION ./gitlab/ RUN set -eux; \ make gitlab-shell-setup; \ rm -rf $(cat $GEM_CACHE_LOCATION) \ && go clean -cache # Build gitlab-workhorse # COPY --chown=gdk:gdk VERSION GITLAB_WORKHORSE_VERSION ./gitlab/ COPY --chown=gdk:gdk workhorse ./gitlab/workhorse RUN set -eux; \ make gitlab-workhorse-setup \ && mv gitlab/workhorse ./; \ rm -rf $(cat $GEM_CACHE_LOCATION) \ && go clean -cache # Install gitlab gem dependencies # COPY --chown=gdk:gdk Gemfile Gemfile.lock ./gitlab/ COPY --chown=gdk:gdk vendor/gems/ ./gitlab/vendor/gems/ COPY --chown=gdk:gdk gems/ ./gitlab/gems/ RUN make .gitlab-bundle && rm -rf $(cat $GEM_CACHE_LOCATION) # Install gitlab npm dependencies # COPY --chown=gdk:gdk package.json yarn.lock ./gitlab/ COPY --chown=gdk:gdk scripts/frontend/postinstall.js ./gitlab/scripts/frontend/postinstall.js RUN make .gitlab-yarn && yarn cache clean # Executable gdk image # FROM registry.gitlab.com/gitlab-org/gitlab/gitlab-qa-gdk-base:${BASE_TAG} as gdk ENV GITLAB_LICENSE_MODE=test \ GDK_KILL_CONFIRM=true # Copy code COPY --chown=gdk:gdk ./ ./gitlab/ COPY --chown=gdk:gdk qa/gdk/entrypoint ../ # Create missing pids folder and sync compiled workhorse RUN mkdir -p gitlab/tmp/pids \ && rsync -a --remove-source-files workhorse/ gitlab/workhorse/ # Set up GDK RUN make \ redis/redis.conf \ all \ && gdk kill \ && rm -rf $(cat $GEM_CACHE_LOCATION) \ gitaly/_build/cache \ gitaly/_build/deps/git/source \ gitaly/_build/deps/libgit2/source \ gitaly/_build/deps \ gitaly/_build/intermediate \ && go clean -modcache \ && go clean -cache ENTRYPOINT [ "/home/gdk/entrypoint" ] CMD [ "gdk", "tail" ] HEALTHCHECK --interval=10s --timeout=1s --start-period=5s --retries=17 \ CMD curl --fail http://0.0.0.0:3000/users/sign_in || exit 1 EXPOSE 3000