
GitLab allows you to host your own runners to process CI/CD jobs. You can either configure your own...
GitLab allows you to host your own runners to process CI/CD jobs. You can either configure your own local machine or a remote cloud server to run CI/CD jobs but they both come with costs. Running on cloud generates bills while running on your own machine requires to install extra dependencies.
Docker provides an isolated environment for running containers. You can keep runners on your local machine without any spending, and additionally, it offloads dependency management from you. With Docker containers, you can create/destroy runners without the need to clean up any aftermath.
Before we start, if you have any detailed questions, refer to this official document on GitLab: https://docs.gitlab.com/runner/install/docker/#install-the-docker-image-and-start-the-container.
Let's begin!
docker volume create gitlab-runner-config
docker run -it \
-v /var/run/docker.sock:/var/run/docker.sock \
-v gitlab-runner-config:/etc/gitlab-runner \
gitlab/gitlab-runner:latest register
After entering runner's registration details, a config.toml would be saved in the named volume gitlab-runner-config for future use.
<span>2.</span> Publishing ports for website visits
If you CI/CD includes serving a webpage, then don't forget to do port forwarding so that you can access your site via localhost:<PORT> later.
Note that for this to work, your web server in the container should listen to 0.0.0.0:8081 or the container wouldn't be able to detect traffic from your localhost.
docker run -d \
-p 8081:8081 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v gitlab-runner-config:/etc/gitlab-runner \
--name gitlab-runner \
gitlab/gitlab-runner:latest
<span>3.</span> Install required dependencies in your runner
docker exec -it gitlab-runner /bin/bash
# Example
apt-get update
apt-get install -y php-cli screen
You can also use a Dockerfile to make a custom gitlab-runner image if there's too much manual work.
<span>4.</span> Keep it running
The server will keep running unless you explicitly put a stop to it.
Happy Hacking!
gemmaI ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...
communityHey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...
ai(yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...
aiMy laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...
githubactionsI Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...
aiI've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...
Workflows from the Neura Market marketplace related to this DeepSeek resource