GitLab Runner
Less than 1 minute
GitLab Runner ๊ด๋ จ
Docker Run
Prerequisite(s)
For Windows
- Add environment variable
GITLAB_RUNNER_HOME
= โC:\GitLab-Runnerโ
Run
(For Linux)
Linux
docker run -d -it \
--name gitlab-runner \
--restart always \
--volume $GITLAB_RUNNER_HOME/config:/etc/gitlab-runner: \
--volume /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:alpine3.14-bleeding
Windows
docker run -d -it ^
--name gitlab-runner ^
--restart always ^
--volume %GITLAB_HOME%/config:/etc/gitlab-runner: ^
--volume /var/run/docker.sock:/var/run/docker.sock ^
gitlab/gitlab-runner:alpine3.14-bleeding
Option(s)
d
: ๋ฐฑ๊ทธ๋ผ์ด๋ ์คํ.name
: ์ปจํ ์ด๋์ ์ด๋ฆ์ ์ง์ ํ๋ค.restart
: docker desktop์ด ์คํ๋ ๋๋ง๋ค ์๋์ผ๋ก ์คํํ๋ ๋ช ๋ น์ด.volume
: ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋๋ ๊ณณ์ ์ค์ ํด์ค๋ค. ์ ์ฝ๋๋๋ก ๋ผ๋ฉด ๋น์ฐํ ๋ก์ปฌ์$GITLAB_RUNNER_HOME/gitlab
๋๋ ํ ๋ฆฌ๊ฐ ์์ด์ผ ํ๋ค./config
๋๋ ํ ๋ฆฌ๋ ์๋ค๋ฉด ์๋์ผ๋ก ์์ฑํด์ค๋ค.
GitLab ์ ๋ณด ๋ฑ๋ก
์ปจํ ์ด๋๋ก sh์ ๊ทผ ํ ์คํ
docker exec -it gitlab-runner /bin/bash -c "gitlab-runner register"
๐์คํจ ์ ์๋์ ๊ฐ์ ๊ฒฝ์ฐ ๋ฐ์
Enter the GitLab instance URL (for example, https://gitlab.com/):
http://localhost:1980/
Enter the registration token:
Enter a description for the runner:
[29e02072f9d6]:
Enter tags for the runner (comma-separated):
Enter optional maintenance note for the runner:
WARNING: Support for registration tokens and runner parameters in the 'register' command has been deprecated in GitLab Runner 15.6 and will be replaced with support for authentication tokens. For more information, see https://gitlab.com/gitlab-org/gitlab/-/issues/380872
ERROR: Registering runner... failed runner=GR1348941XFBuSpcs status=couldn't execute POST against http://localhost:1980/api/v4/runners: Post "http://localhost:1980/api/v4/runners": dial tcp 127.0.0.1:1980: connect: connection refused
PANIC: Failed to register the runner.
๋์ปค ๊ฐ network ๊ตฌ์ฑ์ด ๋์ด ์์ง ์์ GitLab์ ์ ๊ทผํ ์ ์์.
๐ขDocker Compose ํ์ด์ง์์
docker-compose-gitlab.yml
์ ์ฐธ๊ณ