-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathContainerfile
53 lines (37 loc) · 1.51 KB
/
Containerfile
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
ARG GITLAB_RUNNER_VERSION=v13.12.0
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 runner-bin-host && \
chmod a+x out/binaries/gitlab-runner && \
out/binaries/gitlab-runner --version
FROM registry.access.redhat.com/ubi8:8.5
ARG GITLAB_RUNNER_VERSION
COPY --from=builder /gitlab-runner/out/binaries/gitlab-runner /usr/bin
ENV HOME=/home/gitlab-runner \
VENV=/openstack_driver_venv
ENV PATH="$VENV/bin:$PATH"
LABEL maintainer="Dmitry Misharov <misharov@redhat.com>" \
io.openshift.tags="gitlab,ci,runner" \
name="openstack-gitlab-runner" \
io.k8s.display-name="GitLab runner" \
summary="GitLab runner" \
description="A GitLab runner image with openstack custom executor." \
io.k8s.description="A GitLab runner image with openstack custom executor."
WORKDIR $HOME
COPY cleanup.py env.py config.sh prepare.py run.py requirements.txt start.sh .
RUN dnf install -y --nodocs python38-pip git-core && \
python3.8 -m venv $VENV && \
pip install wheel && \
pip install -r requirements.txt && \
dnf remove -y git-core && \
dnf clean all -y
RUN chgrp -R 0 $HOME && \
chmod +x cleanup.py config.sh prepare.py run.py start.sh && \
chmod -R g=u $HOME
USER 1001
CMD ["./start.sh"]