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: 97406a9df6e9d10c788965b876f210fb6033d5c1 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
ARG BASE_TAG=master

FROM registry.gitlab.com/gitlab-org/gitlab-development-kit/asdf-bootstrapped-verify:main@sha256:934d8caa0a91c2bb9c68fe7bce42ca89fd04c580deea351a21820b45fa74413f 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