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

Dockerfile.gdk « gdk « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0926883d00fa817c745ca10d5e8948bdc49715be (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
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
FROM registry.gitlab.com/gitlab-org/gitlab-development-kit/asdf-bootstrapped-verify:main@sha256:14fa752a80df21f840fc48f4be8561bee21b78886ac718652582fdd788d34c32

ENV GITLAB_LICENSE_MODE=test \
    GDK_KILL_CONFIRM=true

# 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 at specific sha and bootstrap packages
#
ARG GDK_SHA=747ab64be815f5c239d5d63209527a42bd838e83
ARG GEM_CACHE=/home/gdk/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0/cache
RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \
    set -eux; \
    git clone --depth 1 https://gitlab.com/gitlab-org/gitlab-development-kit.git && cd gitlab-development-kit; \
    git fetch --depth 1 origin ${GDK_SHA} && git -c advice.detachedHead=false checkout ${GDK_SHA}; \
    mkdir gitlab && make bootstrap

WORKDIR /home/gdk/gitlab-development-kit

COPY --chown=gdk:gdk qa/gdk/gdk.yml ./

# Build gitlab-shell
#
COPY --chown=gdk:gdk GITLAB_SHELL_VERSION ./gitlab/
RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \
    set -eux; \
    make gitlab-shell-setup \
    && cd gitlab-shell && go clean -cache -modcache -r

# Build gitlab-workhorse
#
COPY --chown=gdk:gdk VERSION GITLAB_WORKHORSE_VERSION ./gitlab/
COPY --chown=gdk:gdk workhorse ./gitlab/workhorse
RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \
    set -eux; \
    make gitlab-workhorse-setup && mv gitlab/workhorse ./ \
    && cd workhorse && go clean -cache -modcache -r

# Build gitaly
#
COPY --chown=gdk:gdk GITALY_SERVER_VERSION ./gitlab/
RUN --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \
    set -eux; \
    make gitaly-setup; \
    cd gitaly \
    && go clean -cache -modcache -r \
    && rm -rf _build/cache \
              _build/deps/git/source \
              _build/deps/libgit2/source \
              _build/deps \
              _build/intermediate

# 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 --mount=type=cache,target=${GEM_CACHE},uid=1000,gid=1000 \
    make .gitlab-bundle

# 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

# 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 SKIP_WORKHORSE_SETUP=true SKIP_GITLAB_SHELL_SETUP=true SKIP_GITALY_SETUP=true \
    make redis/redis.conf all \
    && gdk kill

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