Skip to content

Instantly share code, notes, and snippets.

@neilkuan
Created August 21, 2023 08:21
Show Gist options
  • Save neilkuan/64c9add97a71b84df7057cdbf431fb1d to your computer and use it in GitHub Desktop.
Save neilkuan/64c9add97a71b84df7057cdbf431fb1d to your computer and use it in GitHub Desktop.

Create Gitlab Container Runner at MacOS

  • env:
    • docker-desktop

Create template dir

mkdir $HOME/gitlab-runner

First register

docker run -d -v $HOME/gitlab-runner:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
--name gitlab-runner-register gitlab/gitlab-runner:alpine \
register --non-interactive --url https://gitlab.com \
--registration-token ${GITLAB_RUNNER_REGISTER_TOKEN}  --docker-pull-policy \
if-not-present --executor docker --docker-image "alpine:latest" --description "lab"

After running

docker run -d -v $HOME/gitlab-runner:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
--name gitlab-runner gitlab/gitlab-runner:alpine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment