Starting the container with configuration settings as input

You can start the GitLab container and let it configure itself at startup by adding the GITLAB_OMNIBUS_CONFIG environment variable to the docker run command.

Put any settings from gitlab.rb in it that you'd like and they will be loaded in the container start procedure before the internal gitlab.rb file. Some examples from the omnibus-gitlab template are as follows and you can add it as argument to docker:

--env GITLAB_OMNIBUS_CONFIG="external_url '
external_url 'GENERATED_EXTERNAL_URL'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.server"
gitlab_rails['smtp_port'] = 465"
gitlab_rails['gitlab_shell_ssh_port'] = 2222

Here's an example that sets the external URL and sets the SMTP server address while starting the container:

sudo docker run --detach 
--hostname gitlab.joustie.nl
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.joustie.nl'; gitlab_rails['smtp_address'] = "smtp.server" "
--publish 443:443 --publish 80:80 --publish 22:22
--name gitlab
--restart always
--volume /srv/gitlab/config:/etc/gitlab
--volume /srv/gitlab/logs:/var/log/gitlab
--volume /srv/gitlab/data:/var/opt/gitlab
gitlab/gitlab-ce:latest

You can add more environment variables, which are documented here: https://docs.gitlab.com/ee/administration/environment_variables.html.

It can take some time for the container to be operational. After starting and configuring, GitLab is reachable via your browser at https://localhost.

The first time you see the GitLab login page, an admin password has to be set up. After you have chosen one and submitted it, you can use it to log in.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.105.108