Build the Ubuntu-based Gitlab CI runner default image
10K+
This image install some useful commands to the Ubuntu official image, that make it easier to use as base image for Gitlab CI/CD runners.
The following packages are installed:
The following npm modules are installed, globally:
The following Perl modules are installed, globally:
We also include some helpers for common CI tasks.
cmd-retryThe cmd-retry helper will repeat the execution of the command given as parameter while a specific
string shows up in the output. For example:
cmd-retry "502 Bad Gateway" docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
This will retry the docker login command while the 502 Bad gateway shows in the command output.
The command will pause 5 seconds between retries and will retry at most 60 seconds.
ci-bootstrapThis command, usually used on before_script blocks, will output several pieces of information
that might be useful to diagnose issues with your jobs.
It will also login into the Gitlab Registry using the environment variable CI_BUILD_TOKEN.
In particular:
_IMAGE: we tipically use a variables block with
BUILD_IMAGE and RELEASE_IMAGE entries to be reused on multiple jobs;git, docker, and docker-compose;perl version and list the cpanfile* files.docker-pull-buildThis wrapper around docker build will read the Dockerfile file and use docker pull on all
images used as FROM.
If the -t or --tag options is present, we will also use pull it to prime the Docker build
cache. See docker-prime-cache for a standalone version of this process.
This is a workaround for a Docker bug that fails to pull images mentioned in a FROM if the
registry is private and requires authentication.
docker-prime-cacheThis script accetps a list of docker images and tries to pull them. If the pull fails, the error is ignored.
It will always exit 0.
This is useful to prime the Docker build cache. If you are building a image named x:latest, you
can pull x:latest before starting the build try and reuse as much layers as possible, because
usually pulling a image is faster than building the same image.
docker-push-retryThis is just a small wrapper script that will accept all of docker push arguments and wrap it
with a cmd-retr '502 Bad Gateway' to work around some unstable Docker Registries.
Content type
Image
Digest
Size
396 MB
Last updated
almost 5 years ago
docker pull melopt/ci-runner-default-image