Created
November 13, 2020 18:23
-
-
Save lgaticaq/d651167d305db7ae9f81086ade372c5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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