Skip to content

Instantly share code, notes, and snippets.

@ildarmf
Created January 23, 2020 15:54
Show Gist options
  • Save ildarmf/3bb40d259977bc98f4d7f10ef6fb662e to your computer and use it in GitHub Desktop.
Save ildarmf/3bb40d259977bc98f4d7f10ef6fb662e to your computer and use it in GitHub Desktop.

Revisions

  1. ildarmf created this gist Jan 23, 2020.
    19 changes: 19 additions & 0 deletions gitlab runner docker registry
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@

    for i in {1..5}; do \
    docker run --rm -d --name shared-runner${i} -v /opt/gitlab/:/opt/gitlab-runner/ -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner register \
    --config "/opt/gitlab-runner/config.toml" \
    --non-interactive \
    --executor "docker" \
    --docker-image docker:19.03.1 \
    --url "https://bla.bla/" \
    --registration-token "*********************" \
    --description "shared-runner${i}" \
    --run-untagged="true" \
    --locked="false" \
    --docker-volumes="/var/run/docker.sock:/var/run/docker.sock" \
    --access-level="not_protected";
    done

    for i in {1..5}; do \
    docker run -d --name shared-runner${i} -v /opt/gitlab/:/opt/gitlab-runner/ -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner run -c /opt/gitlab-runner/config.toml; \
    done