GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline. GitLab Runner is open-source and written in Go. It can be run as a single binary; no language-specific requirements are needed. GitLab Runner can also run inside a Docker container or be deployed into a Kubernetes cluster. Below are some GitLab related contents you may be interested in: How to install, register and start GitLab Runner on Windows, how to uninstall GitLab from your Windows device, Deploying and using Windows containers with Gitlab CI, how to manually update Docker desktop, and how to install and uninstall Docker Desktop on Windows 10 and Windows Server.
Why you should use GitLab: GitLab enables team members to collaborate in every phase of the project. GitLab offers tracking from planning to creation to help developers automate the entire DevOps lifecycle and achieve the best possible results. This technoogy has been embraced by a wide range of developers and system administrators because of its wide assortment of features and brick blocks of code availability.
Enough of the GitLab, let’s discuss the problem and ways to fix this issue confronting us. See the following guides for more information. For how to use AWS CodeCommit, and how to clone a repository and install software from GitHub on Windows.
Reason for this issue?
There are different interpretations on the internet such as that shared in this link. The error was prompted for me because I was not using the token generated by the project runner.
Solution
Turns out I had a wrong token in the config.toml file and this replaced the one generated by the GitLab-register command previously. Entered the right token, boom I was able to unregister the GitLab-runner. At least, this resolved my issue! Below is the syntax of the config.toml
file that is currently being edited to resolve this issue.
Generally, when this is done, GitLab-runner should reload automatically. Bt to be safe, just restart manually to ensure it takes effect.
gitlab-runner.exe restart
Now you should be able to unregister GitLab successfully without any further issues.
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.
Содержание
- Error unregistering runner from GitLab forbidden with docker executor: Fatal failed to unregister runner
- Reason for this issue?
- Solution
- Бегун не здоров и будет отключен
- Runner authentication failed
- Summary
- Steps to reproduce
- Actual behavior
- Expected behavior
- Relevant logs and/or screenshots
- Environment description
- custom_build_dir is not enabled by default
- Summary
- Steps to reproduce
- Actual behavior
- Expected behavior
- Relevant logs and/or screenshots
- Environment description
- Used GitLab Runner version
- Possible solutions
- x509: certificate relies on legacy Common Name field, use SANs instead
- Summary
- Steps to reproduce
- Actual behavior
- Expected behavior
- Relevant logs and/or screenshots
- Environment description
- Possible fixes
Error unregistering runner from GitLab forbidden with docker executor: Fatal failed to unregister runner
GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline. GitLab Runner is open-source and written in Go. It can be run as a single binary; no language-specific requirements are needed. GitLab Runner can also run inside a Docker container or be deployed into a Kubernetes cluster. Below are some GitLab related contents you may be interested in: How to install, register and start GitLab Runner on Windows, how to uninstall GitLab from your Windows device, Deploying and using Windows containers with Gitlab CI, how to manually update Docker desktop, and how to install and uninstall Docker Desktop on Windows 10 and Windows Server.
Enough of the GitLab, let’s discuss the problem and ways to fix this issue confronting us. See the following guides for more information. For how to use AWS CodeCommit, and how to clone a repository and install software from GitHub on Windows.
Reason for this issue?
There are different interpretations on the internet such as that shared in this link. The error was prompted for me because I was not using the token generated by the project runner.
Screenshot 2022 02 08 at 22.28.09
Solution
Turns out I had a wrong token in the config.toml file and this replaced the one generated by the GitLab-register command previously. Entered the right token, boom I was able to unregister the GitLab-runner. At least, this resolved my issue! Below is the syntax of the config.toml file that is currently being edited to resolve this issue.
Screenshot 2022 04 15 at 14.59.35
Generally, when this is done, GitLab-runner should reload automatically. Bt to be safe, just restart manually to ensure it takes effect.
Screenshot 2022 04 15 at 15.08.36
Now you should be able to unregister GitLab successfully without any further issues.
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.
Источник
Бегун не здоров и будет отключен
Я размещаю свой репозиторий в gitlab.com и устанавливаю runner в DigitalOcean . Он работал нормально до сегодняшнего дня, 16 марта 2019 г., 14:24 по тайскому времени.
Конечная цель
Поднимите моего бегуна и бегите снова
Вопрос:
Что означает not healthy ?
Я не могу отменить регистрацию бегуна. Как это исправить?
Без понятия. Но, похоже, gitlab.com удалите мой токен бегуна. Поэтому я должен удалить свой раннер, зарегистрироваться и запустить его снова.
Я впервые интегрировал свой бегун, и любой, кто знаком с gitlab, знает, что это никогда не будет легкой прогулкой. Я потратил много часов на поиски этого сообщения об ошибке, но обнаружил, что смотрю совершенно не в том направлении.
Теперь я считаю, что мой бегун говорил мне, что «бегун» на gitlab.com нездоров и был отклонен (моим бегуном). Когда я оставил его работающим и запустил конвейерное задание, он обработался нормально, с моей стороны не было никаких проблем, я часами ничего не искал!
У меня была такая же проблема, какой-нибудь ответ найден?
Я столкнулся с той же проблемой. Зарегистрируйте бегун, как описано в инструкции по установке. Перейдите к admin/runners и нажмите кнопку Show runner installation instructions . Наиболее важным является сеанс Register runner , в котором вы должны запустить команду register , которая решает описанную проблему. Например, линукс:
Следуйте инструкциям, и все готово.
После того, как ваш бегун настроен и запущен, вы можете добавить изменения в файл конфигурации, остановить и запустить его снова после изменения конфигурации.
Вы можете найти дублирующиеся разделы [[runners]] , это происходит, если вы пытались настроить его самостоятельно, а затем с помощью команды register . Ничего страшного, оставь только один последний.
Источник
Runner authentication failed
Summary
Installed a GitLab Runner today on a new Debian Jessie machine, from the provided apt repository. Registering the runner works, and it seems happy ( status , list and verify are OK). No pipelines ever work, though, as the runner fails to authenticate to GitLab during the attempted git clone (using simplest case of the shell executor with a trivial test script ). Note that the custom GitLab instance (on another machine, using the provided GitLab CE packages, omnibus) is protected with OmniAuth Shibboleth and runs within Apache httpd using mod_passenger (to avoid HTTP proxying to Nginx), which may well account for this error and makes this hard to reproduce elsewhere, I guess.
Steps to reproduce
Set up a runner for a project, use the most trivial CI yaml ever, make a commit to the repo, see it fail. I guess one would need a similar environment, as there’s nothing special about the runner, the repo, the CI or the network connection to GitLab? 😞
Actual behavior
Build fails due to failed authntication to custom GitLab instace. HTTP and HTTPS connections from the runner to the GitLab instance are fine.
Expected behavior
Git clone works and build starts.
Personally I’d much rather give runners deploy keys and have them use SSH for cloning (i.e., all repo access), as that would certainly avoid this error — git clone via SSH works fine from the machine with the runner.
Relevant logs and/or screenshots
From the «pipeline failed» notification email (which was surprisingly detailed, so quite helpful, IMO):
That seems to correspond to these log entries in GitLab’s web server access log (httpd here):
And the last line repeats ad infinitum as long as the runner is running (and registered), even though GitLab already shows the pipeline as failed. The matching entry from GitLab’s /var/log/gitlab/gitlab-rails/production.log seems to be:
which is repeated twice in the log. Then the same (and only this) log line is repeated in production.log until I stop (or unregister) the runner:
A manual clone attempt from the machine with the runner yields these results on the command line:
which corresponds to these events in GitLab’s /var/log/gitlab/gitlab-rails/production.log :
Apache httpd only sees these two requests from that manual clone attempt:
Syslog on the runner machine only has these to offer:
I’ve also attached a copy of the output from gitlab-ci-multi-runner —debug run (the command I found in the FAQ): runner-debug.log
N.B. I’ve nuked (unregistered and registered a new one) the runner once during this testing, so the runner identifiers are not consistent everywhere throughout the above. Don’t let that lead you down the wrong path!
Environment description
GitLab: This is a local and up-to-date (8.14.4-ce.0) GitLab CE Omnibus install from the provided Debian packages using (as indicated above) OmniAuth Shibboleth and running within Apache httpd using mod_passenger (to avoid HTTP proxying to Nginx). I have not noted any other issues with that setup, i.e., everything else works fine AFAICT.
The executor is shell with a trivial script that merely echoes the environment (or runs python —version ) as a first test.
Источник
custom_build_dir is not enabled by default
Summary
Please notice, that the feature — if not configured explicitly — will be enabled by default for kubernetes, docker, docker-ssh, docker+machine and docker-ssh+machine executors. It will be disabled by default for all other executors.
However, when I try using GIT_CLONE_PATH on my Kubernetes runner I get an error message.
What’s worse, there doesn’t seem to be a way to set custom_build_dir via the Helm chart.
Steps to reproduce
Actual behavior
Expected behavior
Job runs normally.
Relevant logs and/or screenshots
Environment description
GitLab runner is deployed on Kubernetes using the Helm chart.
Resultant config.toml from within the pod:
Used GitLab Runner version
Possible solutions
The reason for this is because in here we are checking if it’s nil or not, if it’s nil we fallback to the default configuration. But the issue here is that it’s never nil for new runners since we automatically create [runners.custom_build_dir] as part of the configuration, so it ends up being false by default.
So we need to figure out the following:
- Do we want to stick true to the documentation, and have it enabled by default? (I think this is the best option) To do so we need to have to nullify the value explicitly on register to make sure it’s set correctly by the default value.
- We update the documentation specifying that it’s disabled by default.
Источник
x509: certificate relies on legacy Common Name field, use SANs instead
Summary
I’am experiencing troubles with Gitlab-Runner registration.
Steps to reproduce
I am using official documentation in order to run both applications into single docker-compose.yml file.
Here is my config:
Since our network is local and doesn’t have direct internet access for this network i’am using self-signed certificates for host server.
I’ve been trying different certificates:
- x509 method which is described in official documentation for offline installations
- Locally generated SAN certificates
- Those which are generated from fresh gitlab installation
All three methods leads to described problem.
This certificate is added to gitlab-runner certificated directory and copies to /usr/local/share/ca-certificates.
I can even curl destination gitlab server host:
I’ve been trying different approaches in order to resolve this issue by myself, including changing gitlab.rb file:
omnibus-gitlab#4900 (closed)
gitlab#38255 (moved)
Commenting staging section in file /opt/gitlab/embedded/cookbooks/letsencrypt/resources/certificate.rb
Installing two lower gitlab server versions
Changing docker-compose.yml config
Separated installation of both components
Making varions changes in gitlab.rb file from advices in comments of different issues, like nginx https redirection, etc.
Actual behavior
Since gitlab native method always returns ACME related errors, i’am using self-signed certificates. I can reproduce this error if needed and provide it in comments. But either with self-signed certificate or gitlab native — i always get the same «SAN’s» error.
Expected behavior
I want to runner to connect gitlab server.
Relevant logs and/or screenshots
Gitlab has so many logs, i don’t even know which one i should inspect or provide, i would be grateful if you give me directions.
Environment description
Gitlab version:
GitLab Community Edition 14.7.0
Runner version:
Version: 14.7.0
Git revision: 98daeee0
Git branch: 14-7-stable
GO version: go1.17.5
Built: 2022-01-19T17:11:48+0000
OS/Arch: linux/amd64
Docker version:
Docker version 19.03.6, build 369ce74a3c
Docker-compose version:
docker-compose version 1.25.0, build 0a186604
Possible fixes
I’ve tried to google this problem and i think i’ve tried around 30 or 40 combined solutions from stackoverflow and google search related pages, but i wasn’t able to fix this issue myself.
Since i came to conclusion that i’am not able to fix this issue by myself, i’am asking for help here.
It would be awesome if you give me directions to which way i should move and what logs i should inspect.
Thank you in advance.
Источник
I’m trying to unregister gitlab-runner on EC2 instance (Ubuntu machine) with the following command:
sudo gitlab-runner --debug unregister --token [RUNNER-TOKEN] --url [RUNNER-URL]
and I’m getting following error:
Runtime platform arch=amd64 os=linux pid=2374 revision=6fbc7474 version=13.1.1
Checking runtime mode GOOS=linux uid=0
Running in system-mode.
Dialing: tcp gitlab.com:443 ...
ERROR: Unregistering runner from GitLab forbidden runner=xv2Ng6Tc
FATAL: Failed to unregister runner
3 Answers
Make sure that you’re using the entire SHA, not the partial one listed on the Gitlab CI runners list.
This can be found by running sudo gitlab-runner list
on the machine with the runner installed.
If you’ve already removed the runner in the gitlab runners page, it will still be present on the gitlab-runner machine (check with the command sudo gitlab-runner list
). You should unregister it in the config.toml.
sudo gitlab-runner stop
sudo vi /etc/gitlab-runner/config.toml
# update the runners sectionsudo gitlab-runner start
I experienced the same issue when I tried to remove a runner that was removed directly from Gitlab settings of the project.
It seems that «Remove runner»‘s button removes the runner from Gitlab but not from your gitlab-runner, which is absolutely fine since I don’t want Gitlab to mess up to my on-premise gitlab-runner.
In order to fix that, I stopped the gitlab-runner service, removed the runner directly from the config file (it is usually located in /etc/gitlab-runner/config.toml) and started the service again.
I hope I could help you
If you have already removed it from the Runners section in you project settings then you are no longer able to unregister with command. Then what you can do is to delete them from your host as below:
gitlab-runner verify --delete
This will remove all the unregistered/removed runners from your host machine and will update config.toml
file.
If you haven’t removed it from Runners section in you project settings(Settings -> CI/CD -> Runners
), then you can unregister it from your host like below:
gitlab-runner unregister runner_id/name
or unregister all runners,
gitlab-runner unregister --all-runners
Hope this will help to somebody. cheers !!!
Error unregistering runner from GitLab forbidden with docker executor: Fatal failed to unregister runner
GitLab Runner is an application that works with GitLab CI/CD to run jobs in a pipeline. GitLab Runner is open-source and written in Go. It can be run as a single binary; no language-specific requirements are needed. GitLab Runner can also run inside a Docker container or be deployed into a Kubernetes cluster. Below are some GitLab related contents you may be interested in: How to install, register and start GitLab Runner on Windows, how to uninstall GitLab from your Windows device, Deploying and using Windows containers with Gitlab CI, how to manually update Docker desktop, and how to install and uninstall Docker Desktop on Windows 10 and Windows Server.
Enough of the GitLab, let’s discuss the problem and ways to fix this issue confronting us. See the following guides for more information. For how to use AWS CodeCommit, and how to clone a repository and install software from GitHub on Windows.
Reason for this issue?
There are different interpretations on the internet such as that shared in this link. The error was prompted for me because I was not using the token generated by the project runner.
Screenshot 2022 02 08 at 22.28.09
Solution
Turns out I had a wrong token in the config.toml file and this replaced the one generated by the GitLab-register command previously. Entered the right token, boom I was able to unregister the GitLab-runner. At least, this resolved my issue! Below is the syntax of the config.toml file that is currently being edited to resolve this issue.
Screenshot 2022 04 15 at 14.59.35
Generally, when this is done, GitLab-runner should reload automatically. Bt to be safe, just restart manually to ensure it takes effect.
Screenshot 2022 04 15 at 15.08.36
Now you should be able to unregister GitLab successfully without any further issues.
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.
Источник
Отмена регистрации gitlab-runner в Ubuntu не работает
Я пытаюсь отменить регистрацию gitlab-runner на экземпляре EC2 (компьютер Ubuntu) с помощью следующей команды:
И я получаю следующую ошибку:
4 ответа
Я столкнулся с той же проблемой. Мне пришлось ввести правильный токен в файл config.toml, и бум, это сработало: см. это руководство для получения дополнительной информации: https: //gitlab.com/gitlab-org/gitlab-runner/-/issues/4919. Это решение специально для Windows, но может быть применимо и к Ubuntu.
Убедитесь, что вы используете весь SHA, а не частичный, указанный в списке исполнителей Gitlab CI.
Это можно узнать, запустив sudo gitlab-runner list на машине с установленным исполнителем.
Если вы уже удалили бегун на странице бегунов gitlab, он все равно будет присутствовать на машине gitlab-runner (проверьте с помощью команды sudo gitlab-runner list ).
Затем вы можете отменить его регистрацию в config.toml с помощью команды:
Или вручную, запустив:
- sudo gitlab-runner stop
- sudo vi /etc/gitlab-runner/config.toml # обновить раздел бегунов
- sudo gitlab-runner start
Для MacOS и Ubuntu
Если вы уже удалили его из раздела Runners в настройках вашего проекта, вы больше не сможете отменить регистрацию с помощью команды. Затем вы можете удалить их с вашего хоста, как показано ниже:
Это удалит все незарегистрированные/удаленные бегуны с вашего хост-компьютера и обновит файл config.toml .
Если вы не удалили его из раздела Runners в настройках вашего проекта( Settings -> CI/CD -> Runners ), вы можете отменить его регистрацию на своем хосте, как показано ниже:
Или отменить регистрацию всех бегунов,
Надеюсь, это поможет кому-то. ваше здоровье .
У меня возникла та же проблема, когда я попытался удалить бегун, который был удален непосредственно из настроек проекта Gitlab. Кажется, что кнопка «Удалить бегун» удаляет бегун из Gitlab, но не из вашего gitlab-runner, что абсолютно нормально, поскольку я не хочу, чтобы Gitlab испортил мой локальный gitlab-runner.
Источник
GitLab Runner registration token changed by itself
Summary
Our CI/CD stopped working recently because the tokens no longer matched. Not sure if this is related to gitlab-ce#4235.
Steps to reproduce
I honestly don’t know — I just came back from a few days of vacation and apparently our CI/CD has not been working (it used to work pretty well).
The first error message I got was this:
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (executor_docker.go:968:0s)
I was able to fix this by running sudo systemctl start docker — I also used sudo systemctl enable docker to automatically start the daemon whenever the server is rebooted.
However our CI/CD still doesn’t work — I now get a different error:
Fetching changes.
remote: You are not allowed to download code from this project. fatal: unable to access ‘http://gitlab-ci-token:[MASKED]@domain.com/group/project.git/’: The requested URL returned error: 403
So I was investigating this one and it turns out that the registration token has apparently changed without us having to manually reset it?
What is the current bug behavior?
The registration token found on http://domain.com/group/project/settings/ci_cd is different from the token that is shown when I ran gitlab-runner list on the terminal.
What is the expected correct behavior?
The two tokens must match (our CI/CD has been working since we started using GitLab — more than 2 years ago).
Источник
Upon Cancelling a Running Job, server running gitlab-runner gets «ERROR: Checking for jobs. forbidden»
Summary
I have successfully registered runners and jobs are being built and everything is fine and dandy.
But, then. if a build gets cancelled, it stop accepting jobs.
When trying to debug I am finding following: gitlab-runner —debug verify
gitlab-runner —debug run
gitlab-runner —version
I have tried stopping, starting and restarting the Gitlab-runner Also restarting the VM/Server Dosen’t work.
Sometimes updating the version works.
Steps to reproduce
- Start a job
- Cancel the job
- Wait for it to start next job
- Nothing happens.
- Wait for about 1h and it starts accepting jobs
Seems to make is start again
What is the current bug behavior?
Cancelling a job stops the runner from picking up new jobs
What is the expected correct behavior?
When cancelling a job, it should just pick up next available job
Relevant logs and/or screenshots
(Paste any relevant logs — please use code blocks («`) to format console output, logs, and code as it’s very hard to read otherwise.)
Output of checks
This is happening on our private gitlab
Results of GitLab environment info
GitLab 10.8.0 (gitlab-ce@55e4a0b334139a5b5949c91c8325b330e425989b) GitLab Shell 7.1.2 GitLab Workhorse v4.2.0 GitLab API
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
Источник
Runner authentication failed
Summary
Installed a GitLab Runner today on a new Debian Jessie machine, from the provided apt repository. Registering the runner works, and it seems happy ( status , list and verify are OK). No pipelines ever work, though, as the runner fails to authenticate to GitLab during the attempted git clone (using simplest case of the shell executor with a trivial test script ). Note that the custom GitLab instance (on another machine, using the provided GitLab CE packages, omnibus) is protected with OmniAuth Shibboleth and runs within Apache httpd using mod_passenger (to avoid HTTP proxying to Nginx), which may well account for this error and makes this hard to reproduce elsewhere, I guess.
Steps to reproduce
Set up a runner for a project, use the most trivial CI yaml ever, make a commit to the repo, see it fail. I guess one would need a similar environment, as there’s nothing special about the runner, the repo, the CI or the network connection to GitLab? 😞
Actual behavior
Build fails due to failed authntication to custom GitLab instace. HTTP and HTTPS connections from the runner to the GitLab instance are fine.
Expected behavior
Git clone works and build starts.
Personally I’d much rather give runners deploy keys and have them use SSH for cloning (i.e., all repo access), as that would certainly avoid this error — git clone via SSH works fine from the machine with the runner.
Relevant logs and/or screenshots
From the «pipeline failed» notification email (which was surprisingly detailed, so quite helpful, IMO):
That seems to correspond to these log entries in GitLab’s web server access log (httpd here):
And the last line repeats ad infinitum as long as the runner is running (and registered), even though GitLab already shows the pipeline as failed. The matching entry from GitLab’s /var/log/gitlab/gitlab-rails/production.log seems to be:
which is repeated twice in the log. Then the same (and only this) log line is repeated in production.log until I stop (or unregister) the runner:
A manual clone attempt from the machine with the runner yields these results on the command line:
which corresponds to these events in GitLab’s /var/log/gitlab/gitlab-rails/production.log :
Apache httpd only sees these two requests from that manual clone attempt:
Syslog on the runner machine only has these to offer:
I’ve also attached a copy of the output from gitlab-ci-multi-runner —debug run (the command I found in the FAQ): runner-debug.log
N.B. I’ve nuked (unregistered and registered a new one) the runner once during this testing, so the runner identifiers are not consistent everywhere throughout the above. Don’t let that lead you down the wrong path!
Environment description
GitLab: This is a local and up-to-date (8.14.4-ce.0) GitLab CE Omnibus install from the provided Debian packages using (as indicated above) OmniAuth Shibboleth and running within Apache httpd using mod_passenger (to avoid HTTP proxying to Nginx). I have not noted any other issues with that setup, i.e., everything else works fine AFAICT.
The executor is shell with a trivial script that merely echoes the environment (or runs python —version ) as a first test.
Источник
@sameersbn @panosoft @mikew
hi, first of all to thank you for this community and for the contribution you make to the informatics.
My problem is this, I’m working with docker-gitlab sameersbn: 8.16.6, postgresql:9.6-2, redis:latest, registry:2.5, nginx. All working properly as far as I could see but I have configured gitlab-runner:latest for continuous integration and I got the following error when registering a runner for gitlab: «ERROR: Registering runner… failed runner=xrz3LPZ status=couldn’t execute POST against https://localhost:10443/ci/api/v1/runners/register.json: Post https://localhost:10443/ci/api/v1/runners/register.json: dial tcp [::1]:10443: getsockopt: connection refused
PANIC: Failed to register this runner. Perhaps you are having network problems «_.
I do not know if something in my configuration is wrong or something is missing to configure for this to work, please I need help this is very important for the project.
Then I describe my working environment together with my configuration file docker-compose.yml.
version: '2'
networks:
lb_web:
external: true
back:
driver: bridge
services:
redis:
restart: always
image: sameersbn/redis:latest
container_name: redis
command:
- --loglevel warning
volumes:
- /srv/docker/gitlab/redis:/var/lib/redis:Z
networks:
- back
postgresql:
restart: always
image: sameersbn/postgresql:9.6-2
container_name: postgresql
volumes:
- /srv/docker/gitlab/postgresql:/var/lib/postgresql:Z
environment:
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
- DB_EXTENSION=pg_trgm
networks:
- back
gitlab:
restart: always
image: sameersbn/gitlab:8.16.6
container_name: gitlab
depends_on:
- redis
- postgresql
external_links:
- registry:registry.localhost
expose:
- "80"
ports:
- "10022:22"
- "10443:443"
- "5005:5005"
volumes:
- /srv/docker/gitlab/gitlab:/home/git/data:Z
- /srv/docker/gitlab/gitlab/certs:/home/git/data/certs
- /srv/docker/gitlab/logs:/var/log/gitlab
- /var/run/docker.sock:/var/run/docker.sock
hostname: localhost
environment:
- DEBUG=false
- DB_ADAPTER=postgresql
- DB_HOST=postgresql
- DB_PORT=5432
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
- REDIS_HOST=redis
- REDIS_PORT=6379
- TZ=America/Los_Angeles
- GITLAB_TIMEZONE=America/Los_Angeles
- GITLAB_HTTPS=true
- SSL_SELF_SIGNED=true
- GITLAB_HOST=localhost
- GITLAB_PORT=10443
- GITLAB_SSH_PORT=10022
- GITLAB_RELATIVE_URL_ROOT=
- GITLAB_SECRETS_DB_KEY_BASE=xxxxxxxx
- GITLAB_SECRETS_SECRET_KEY_BASE=xxxxxxx
- GITLAB_SECRETS_OTP_KEY_BASE=xxxxxx
- GITLAB_ROOT_PASSWORD=xxxxx
- GITLAB_ROOT_EMAIL=xxxx@gmail.com
- GITLAB_NOTIFY_ON_BROKEN_BUILDS=true
- GITLAB_NOTIFY_PUSHER=true
- GITLAB_EMAIL=xxxxx@gmail.com
- GITLAB_EMAIL_REPLY_TO=xxxxxx@gmail.com
- GITLAB_INCOMING_EMAIL_ADDRESS=xxxxxx@gmail.com
- GITLAB_BACKUP_SCHEDULE=daily
- GITLAB_BACKUP_TIME=01:00
- SMTP_ENABLED=true
- SMTP_DOMAIN=www.gmail.com
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USER=xxxxx@gmail.com
- SMTP_PASS=password
- SMTP_STARTTLS=true
- SMTP_AUTHENTICATION=login
- IMAP_ENABLED=true
- IMAP_HOST=imap.gmail.com
- IMAP_PORT=993
- IMAP_USER=xxxx@gmail.com
- IMAP_PASS=password
- IMAP_SSL=true
- IMAP_STARTTLS=
- VIRTUAL_HOST=localhost
- SSL_CERTIFICATE_PATH=/home/git/data/certs/gitlab.crt
- SSL_KEY_PATH =/home/git/data/certs/gitlab.key
- SSL_CA_CERTIFICATES_PATH=/home/git/data/certs/gitlab.crt
- SSL_DHPARAM_PATH=/home/git/data/certs/dhparam.pem
- GITLAB_REPOS_DIR=/home/git/data/repositories
- GITLAB_BACKUP_DIR=/home/git/data/backups
- GITLAB_SHARED_DIR=/home/git/data/shared
- GITLAB_BUILDS_DIR=/home/git/data/builds
- GITLAB_ARTIFACTS_DIR=/home/git/data/shared/artifacts
- GITLAB_PROJECTS_CONTAINER_REGISTRY=true
- GITLAB_REGISTRY_DIR=/home/git/data/shared/registry
- GITLAB_REGISTRY_ENABLED=true
- GITLAB_REGISTRY_HOST=registry.localhost
- GITLAB_REGISTRY_PORT=5005
- GITLAB_REGISTRY_API_URL=http://registry.localhost:5000
- GITLAB_REGISTRY_CERT_PATH=/home/git/data/certs/registry.crt
- GITLAB_REGISTRY_KEY_PATH=/home/git/data/certs/registry.key
- GITLAB_REGISTRY_ISSUER=gitlab-issuer
- SSL_REGISTRY_KEY_PATH=/home/git/data/certs/registry.key
- SSL_REGISTRY_CERT_PATH=/home/git/data/certs/registry.crt
networks:
- back
- lb_web
registry:
restart: always
image: registry:2.5
container_name: registry
volumes:
- /srv/docker/registry:/registry
- /srv/docker/gitlab/gitlab/certs:/home/git/data/certs
ports:
- "5000:5000"
external_links:
- "gitlab:localhost"
environment:
- REGISTRY_LOG_LEVEL=info
- REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/registry
- REGISTRY_AUTH_TOKEN_REALM=https://localhost:10443/jwt/auth
- REGISTRY_AUTH_TOKEN_SERVICE=container_registry
- REGISTRY_AUTH_TOKEN_ISSUER=gitlab-issuer
- REGISTRY_AUTH_TOKEN_ROOTCERTBUNDLE=/home/git/data/certs/registry.crt
- REGISTRY_STORAGE_DELETE_ENABLED=true
- REGISTRY_HTTP_SECRET=xxxxxx
networks:
- back
nginx:
restart: always
image: nginx
container_name: nginx
links:
- registry
volumes:
- /srv/docker/nginx/nginx.conf:/etc/nginx/nginx.conf
environment:
- VIRTUAL_HOST=registry.localhost
- REGISTRY_HTTP_RELATIVEURLS=true
networks:
- back
- lb_web
gitlab-runner:
restart: always
image: gitlab/gitlab-runner:latest
container_name: gitlab-runner
volumes:
- /srv/gitlab-runner/config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
- /srv/docker/gitlab/gitlab/certs:/etc/gitlab-runner/certs
environment:
- CA_CERTIFICATES_PATH=/home/git/data/certs/gitlab.crt
networks:
- back
Thanks in advance, any help and comment is welcome.