Commit 69d0a010 authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Build a lot of docker images

parent 9e43757d
# We use the onbuild version of library/golang,
# (https://github.com/docker-library/golang/blob/master/1.4/onbuild/Dockerfile)
# This image is used to create bleeding edge docker image and is not compatible with any other image
FROM golang:onbuild
# Set working directory to /data
#
# this is where the config.toml will be sourced,
# you can mount your own custom data directory at /data
WORKDIR /data
VOLUME /data
# Install runner
RUN /go/src/app/dockerfiles/packaging/root/usr/share/gitlab-runner/post-install
# init sets up the environment and launches gitlab-ci-multi-runner
ENTRYPOINT ["/go/src/app/packaging/docker/init"]
CMD ["run"]
# Preserve runner's data
VOLUME ["/etc/gitlab-runner", "/home/gitlab-runner"]
# init sets up the environment and launches gitlab-runner
ENTRYPOINT ["/go/src/app/dockerfiles/ubuntu/entrypoint"]
CMD ["run", "--user=gitlab-runner", "--working-directory=/home/gitlab-runner"]
`gitlab/runner:alpine` is image with minimal footprint based on Alpine Linux that runs GitLab Runner.
`gitlab/dind` is image that should be used to build projects with docker-based workflow.
The image runs `Docker Engine` and includes `Docker Compose` which allows to use full `docker` toolkit from build script.
`wait` is a really small Docker utility that blocks until another container is accepting TCP connections.
`gitlab/runner-wait` is a really small Docker utility that blocks until another container is accepting TCP connections.
Use it like this:
......
......@@ -9,6 +9,9 @@ RUN echo "deb https://packages.gitlab.com/runner/gitlab-ci-multi-runner/ubuntu/
apt-get update -y && \
apt-get install -y gitlab-ci-multi-runner
ADD entrypoint /
RUN chmod +x /entrypoint
VOLUME ["/etc/gitlab-runner", "/home/gitlab-runner"]
ENTRYPOINT ["gitlab-ci-multi-runner"]
ENTRYPOINT ["/entrypoint"]
CMD ["run", "--user=gitlab-runner", "--working-directory=/home/gitlab-runner"]
`gitlab/runner:latest` is image that can be used to run GitLab Runner in container.
#!/bin/bash
# gitlab-ci-multi-runner data directory
DATA_DIR="/data"
DATA_DIR="/etc/gitlab-runner"
CONFIG_FILE=${CONFIG_FILE:-$DATA_DIR/config.toml}
# custom certificate authority path
CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-$DATA_DIR/certs/ca.crt}
LOCAL_CA_PATH="/usr/local/share/ca-certificates/ca.crt"
update_ca () {
update_ca() {
echo "Updating CA certificates..."
cp "${CA_CERTIFICATES_PATH}" "${LOCAL_CA_PATH}"
update-ca-certificates --fresh >/dev/null
......@@ -15,13 +15,7 @@ update_ca () {
if [ -f "${CA_CERTIFICATES_PATH}" ]; then
# update the ca if the custom ca is different than the current
cmp --silent "${CA_CERTIFICATES_PATH}" "${LOCAL_CA_PATH}" \
|| update_ca
fi
if [ ! -f "${CONFIG_FILE}" ]; then
# create config file if it does not exist
mkdir -p $(dirname "${CONFIG_FILE}") && touch "${CONFIG_FILE}"
cmp --silent "${CA_CERTIFICATES_PATH}" "${LOCAL_CA_PATH}" || update_ca
fi
# launch gitlab-ci-multi-runner passing all arguments
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment