-
Notifications
You must be signed in to change notification settings - Fork 20
/
helper.Dockerfile
48 lines (34 loc) · 1.6 KB
/
helper.Dockerfile
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
ARG GITLAB_RUNNER_VERSION=master
FROM registry.access.redhat.com/ubi8:8.5 AS builder
ARG GITLAB_RUNNER_VERSION
ENV GITLAB_REPO=https://gitlab.com/gitlab-org/gitlab-runner.git \
PATH=$PATH:/root/go/bin/
RUN dnf install -y git-core make go ncurses && \
git clone --depth=1 --branch=${GITLAB_RUNNER_VERSION} ${GITLAB_REPO} && \
cd gitlab-runner && \
make helper-bin-host && \
chmod a+x out/binaries/gitlab-runner-helper/gitlab-runner-helper.x86_64 && \
out/binaries/gitlab-runner-helper/gitlab-runner-helper.x86_64 --version
FROM registry.access.redhat.com/ubi8-minimal:8.5
ARG GITLAB_RUNNER_VERSION
COPY --from=builder /gitlab-runner/out/binaries/gitlab-runner-helper/gitlab-runner-helper.x86_64 \
/usr/bin/gitlab-runner-helper
COPY --from=builder /gitlab-runner/dockerfiles/runner-helper/scripts/ /usr/bin
ENV HOME=/home/workspace \
GITLAB_RUNNER_VERSION=${GITLAB_RUNNER_VERSION:-"master"}
LABEL maintainer="Dmitry Misharov <[email protected]>" \
version="$GITLAB_RUNNER_VERSION" \
io.openshift.tags="gitlab,ci,runner" \
name="ocp-gitlab-helper" \
io.k8s.display-name="GitLab helper" \
summary="GitLab helper" \
description="A GitLab helper image designed to work in OpenShift." \
io.k8s.description="A GitLab helper image designed to work in OpenShift." \
url="https://github.com/RedHatQE/ocp-gitlab-runner"
WORKDIR $HOME
RUN microdnf --disableplugin=subscription-manager install -y hostname git-core git-lfs perl-interpreter --nodocs && \
microdnf clean all && \
chgrp -R 0 $HOME && \
chmod -R g=u $HOME
USER 1001
CMD ["sh"]