The purpose is multiple:
- Using Docker to run a GitLab runner which use Docker images to execute jobs.
- Create a Docker image for building C++ projects which are uploaded to a self-hosted Sonatype Nexus server.
- Enable GitLab runner cache using the S3-API from a self-hosted MinIO server using a Docker image.
- Use the Docker image in JetBrain's CLion for checking the image only.
Running GitLab provided Docker image (gitlab/gitlab-runner:latest
) for running a runner.
A script gitlab-runner.sh
is provided to execute it.
To build C++ projects using a Docker image the next Docker configuration is used
Dockerfile
.
Applications within the Docker image to C++ projects are:
- CMake
- CTest
- CPack
- Doxygen
- CLang-Format v19
- Qt v6.5.1 library (Linux & Windows using a cross-compiler)
To create the image and upload it to the Sonatype Nexus server the script cpp-builder.sh is created to handle it.
Set up MinIO server using a docker image named (minio/minio:latest
) and for the controlling
the server from the command line the image (minio/mc:latest
).
For easy usage and set up the script minio.sh is used.
To have CLion compile CMake projects using Qt arguments passed to the Docker run
command need to be
changed in order to have the original entrypoint to execute the command.
CLion Docker command-line arguments: --rm --privileged --user 0:0 --env USER_LOCAL="<uid>:<gid>"
where uid and gid is the current users user and group id.
Debugging is not possible since the intermediate entrypoint.sh
script prevents this.
Running a console application is possible from CLion.
Running GUI applications the X11 socket needs to be configured with additional run options
--env DISPLAY --volume "${HOME}/.Xauthority:/home/user/.Xauthority:ro"
.
CLion does not do variable expansion for Docker command line arguments so expand them manually.