Dockerfile 1.2 KB
Newer Older
1
FROM alpine:3.8
2

3
RUN adduser -D -S -h /home/gitlab-runner gitlab-runner
4

5
RUN apk add --update \
6 7 8 9
    bash \
    ca-certificates \
    git \
    openssl \
10
    tzdata \
11
    wget
12

13 14
ARG DOCKER_MACHINE_VERSION
ARG DUMB_INIT_VERSION
15

16
COPY gitlab-runner-linux-amd64 /usr/bin/gitlab-runner
17
COPY checksums /tmp/
18 19
RUN chmod +x /usr/bin/gitlab-runner && \
    ln -s /usr/bin/gitlab-runner /usr/bin/gitlab-ci-multi-runner && \
20 21 22
    gitlab-runner --version && \
    mkdir -p /etc/gitlab-runner/certs && \
    chmod -R 700 /etc/gitlab-runner && \
23
    wget -q https://github.com/docker/machine/releases/download/v${DOCKER_MACHINE_VERSION}/docker-machine-Linux-x86_64 -O /usr/bin/docker-machine && \
24 25
    chmod +x /usr/bin/docker-machine && \
    docker-machine --version && \
26
    wget -q https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64 -O /usr/bin/dumb-init && \
27 28
    chmod +x /usr/bin/dumb-init && \
    dumb-init --version && \
29
    sha256sum -c -w /tmp/checksums
30

31
COPY entrypoint /
32 33 34 35 36
RUN chmod +x /entrypoint

VOLUME ["/etc/gitlab-runner", "/home/gitlab-runner"]
ENTRYPOINT ["/usr/bin/dumb-init", "/entrypoint"]
CMD ["run", "--user=gitlab-runner", "--working-directory=/home/gitlab-runner"]