DEV Community

Tomasz Szuster
Tomasz Szuster

Posted on • Edited on

1

GitLab runner on MacBook with docker-compose

It turned out that running a self-hosted Gitlab runner on a MacBook with docker desktop and docker-compose was not so common approach.

Below are code snippets that enable that solution

  • docker-compose.yaml
version: '3'
services:

 gitlab-runner:
  image: gitlab/gitlab-runner:alpine
  restart: always
  container_name: gitlab-runner
  hostname: gitlab-runner
  volumes:
   - /Users/gitlab-runner:/etc/gitlab-runner
   - /var/run/docker.sock:/var/run/docker.sock
  environment:
    - DOCKER_HOST=unix:///var/run/docker.sock
  networks:
      - gitlab-network

networks:
  gitlab-network:
    name: gitlab-network
Enter fullscreen mode Exit fullscreen mode
  • runner configuration config.yaml
concurrent = 2
check_interval = 0
shutdown_timeout = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "docker-stable"
  url = "https://gitlab.com"
  id = 112233
  token = "112233"
  token_obtained_at = 1111-01-24T21:09:11Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "docker"
  [runners.cache]
    MaxUploadedArchiveSize = 0
  [runners.docker]
    tls_verify = false
    image = "docker:stable"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
    network_mode = "host"
    shm_size = 0
    network_mtu = 0

Enter fullscreen mode Exit fullscreen mode

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay