docker volume create --label type=gitlab-17.2 --label env=dev gitlab-17.2-conf
docker volume create --label type=gitlab-17.2 --label env=dev gitlab-17.2-data
docker volume create --label type=gitlab-17.2 --label env=dev gitlab-17.2-logs
sudo docker run --detach \
--hostname gitlab.example.com \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.example.com:8929'; gitlab_rails['gitlab_shell_ssh_port'] = 2424" \
--publish 8929:8929 --publish 2424:22 \
--name gitlab-17 \
--restart always \
--volume gitlab-17.2-conf:/etc/gitlab \
--volume gitlab-17.2-data:/var/opt/gitlab \
--volume gitlab-17.2-logs:/var/log/gitlab \
--shm-size 256m \
gitlab/gitlab-ce:17.2.4-ce.0
sudo docker exec -it gitlab-17 /bin/bash
tee -a /etc/gitlab/gitlab.rb <<-'EOF'
external_url "http://gitlab.example.com:8929"
gitlab_rails['gitlab_shell_ssh_port'] = 2424
EOF
gitlab-ctl reconfigure
ylzx@scyl043:~$ docker exec -it gitlab-17 cat /etc/gitlab/initial_root_password
# WARNING: This value is valid only in the following conditions
# 1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
# 2. Password hasn't been changed manually, either via UI or via command line.
#
# If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
Password: LQj0BIjkK3PD7uxlZT/k/nziqlVNhMsskpOcwiD9/Zk333=
# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
ylzx@scyl043:~$
http://192.168.110.43:8929/