Skip to content

Instantly share code, notes, and snippets.

@lgaticaq
Created November 13, 2020 18:23
Show Gist options
  • Save lgaticaq/d651167d305db7ae9f81086ade372c5d to your computer and use it in GitHub Desktop.
Save lgaticaq/d651167d305db7ae9f81086ade372c5d to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
VERSION=$(curl -s "https://hub.docker.com/v2/repositories/gitlab/gitlab-runner/tags/?page_size=50" | sed "s/,/\n/g" | grep name | cut -d '"' -f 4 | grep -E "^v[0-9]+.[0-9]+.[0-9]+$" | sort -r | head -n 1)
docker pull "gitlab/gitlab-runner:$VERSION"
docker stop gitlab-runner && docker rm gitlab-runner
docker run -d --name gitlab-runner --restart always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
"gitlab/gitlab-runner:$VERSION"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment