Last active
October 4, 2024 14:06
-
-
Save lukaszlach/7ad6e10ae363b12303e0be36c0f2955d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
version: '3.5' | |
services: | |
gitlab: | |
image: gitlab/gitlab-ce:latest | |
container_name: gitlab | |
restart: always | |
environment: | |
GITLAB_OMNIBUS_CONFIG: | | |
external_url 'http://${GITLAB_HOST}' | |
registry_external_url 'http://${GITLAB_REGISTRY_HOST}' | |
gitlab_rails['initial_root_password'] = 'passw0rd' | |
gitlab_rails['initial_shared_runners_registration_token'] = 't0ken' | |
ports: | |
- 80:80 | |
volumes: | |
- ./gitlab/config:/etc/gitlab | |
- ./gitlab/logs:/var/log/gitlab | |
- ./gitlab/data:/var/opt | |
networks: | |
default: | |
aliases: | |
- "${GITLAB_HOST}" | |
- "${GITLAB_REGISTRY_HOST}" | |
- "${GITLAB_PAGES_HOST}" | |
gitlab-runner: | |
image: gitlab/gitlab-runner:alpine | |
container_name: gitlab-runner | |
restart: always | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- ./gitlab-runner/config:/etc/gitlab-runner | |
depends_on: | |
- gitlab | |
register-gitlab-runner: | |
image: gitlab/gitlab-runner:alpine | |
volumes: | |
- ./gitlab-runner/config:/etc/gitlab-runner | |
command: | |
- register | |
- --non-interactive | |
- --locked=false | |
- --run-untagged | |
- --name=GitLab Runner | |
- --tag-list=docker,dind | |
- --executor=docker | |
- --docker-image=docker:stable | |
- --docker-volumes=/var/run/docker.sock:/var/run/docker.sock | |
- --docker-network-mode=gitlab-default | |
environment: | |
- "CI_SERVER_URL=http://${GITLAB_HOST}" | |
- "REGISTRATION_TOKEN=t0ken" | |
depends_on: | |
- gitlab | |
networks: | |
default: | |
name: gitlab-default |
@BuildWithLal your should change a feature flag to be able to revert back to previous behavior, ref. link https://docs.gitlab.com/ee/administration/settings/continuous_integration.html#enable-runner-registrations-tokens
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This no longer works in latest GitLab. From GitLab docs
And i am not seeing a way to feed a predefined shared authentication token in GitLab config/env-vars unless you create it in GitLab administration/runner creation.
Also the flag
--tag-list
is not supported as well when using newly introduced authentication token