forked from tobilg/gitlab-ci-runner-marathon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.88 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
FROM ubuntu:16.04
MAINTAINER TobiLG <[email protected]>
# Download dumb-init
ADD https://github.com/Yelp/dumb-init/releases/download/v1.0.2/dumb-init_1.0.2_amd64 /usr/bin/dumb-init
ENV DIND_COMMIT 3b5fac462d21ca164b3778647420016315289034
ENV GITLAB_RUNNER_VERSION=11.11.2
ENV DOCKER_ENGINE_VERSION=1.13.1-0~ubuntu-xenial
# Install components and do the preparations
# 1. Install needed packages
# 2. Install GitLab CI runner
# 3. Install mesosdns-resolver
# 4. Install Docker
# 5. Install DinD hack
# 6. Cleanup
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y ca-certificates apt-transport-https curl dnsutils bridge-utils lsb-release software-properties-common && \
chmod +x /usr/bin/dumb-init && \
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | bash && \
apt-get update -y && \
apt-get install -y gitlab-runner=${GITLAB_RUNNER_VERSION} && \
mkdir -p /etc/gitlab-runner/certs && \
chmod -R 700 /etc/gitlab-runner && \
curl -sSL https://raw.githubusercontent.com/tobilg/mesosdns-resolver/master/mesosdns-resolver.sh -o /usr/local/bin/mesosdns-resolver && \
chmod +x /usr/local/bin/mesosdns-resolver && \
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \
apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' && \
apt-get update && \
apt-get install -y docker-engine=${DOCKER_ENGINE_VERSION} && \
curl -sSL https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind -o /usr/local/bin/dind && \
chmod a+x /usr/local/bin/dind && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Add wrapper script
ADD register_and_run.sh /
# Expose volumes
VOLUME ["/var/lib/docker", "/etc/gitlab-runner", "/home/gitlab-runner"]
ENTRYPOINT ["/usr/bin/dumb-init", "/register_and_run.sh"]