-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (49 loc) · 1.84 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
FROM gitlab/gitlab-runner:ubuntu
MAINTAINER Michał "rysiek" Woźniak <[email protected]>
#
# a Gitlab CI container with ability to install additional packages at buildtime
#
# environment
ENV DEBIAN_FRONTEND=noninteractive
# uid and gid of the gitlab-runner user
ARG GITLAB_RUNNER_UID=999
ARG GITLAB_RUNNER_GID=999
# and let's modify the group and the user
RUN groupmod --gid ${GITLAB_RUNNER_GID} gitlab-runner \
&& usermod --uid "${GITLAB_RUNNER_UID}" gitlab-runner
# adding repository keys
ARG ADD_REPOSITORY_KEYS=
RUN if [ "$ADD_REPOSITORY_KEYS" != "" ]; then \
DEBIAN_FRONTEND=noninteractive apt-get -q update && \
apt-get -q -y --no-install-recommends install \
gnupg \
apt-transport-https \
ca-certificates \
lsb-release && \
apt-get -q clean && \
apt-get -q -y autoremove && \
rm -rf /var/lib/apt/lists/* && \
echo "$ADD_REPOSITORY_KEYS" | sed -e 's/^[[:space:]]*//' | apt-key add - ; \
fi
# adding repositories
ARG ADD_REPOSITORIES=
RUN if [ "$ADD_REPOSITORIES" != "" ]; then \
echo "$ADD_REPOSITORIES" | sed -e 's/^[[:space:]]*//' > /etc/apt/sources.list.d/added-from-docker-build-arg.list ; \
fi
# we might need to install some packages, but doing this in the entrypoint doesn't make any sense
# we also need the `locales` package for `locale-gen`
ARG INSTALL_PACKAGES=
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y \
locales \
$INSTALL_PACKAGES \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# just in case some tool needs UTF-8 support
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN locale-gen en_US.UTF-8
# copy in the entrypoint script
COPY entrypoint /
RUN chmod +x /entrypoint
VOLUME ["/etc/gitlab-runner", "/home/gitlab-runner", "/output"]