Gitlab runner failed to run non-80 port


I’ve read this post, and it seems that’s not applying in my specific case.

I’m running gitlab in docker with command:

sudo docker pull gitlab/gitlab-ce

mkdir -pv /data/gitlab

sudo docker run --detach \
  --hostname \
  --shm-size 1024m \
  -p 50443:443 \
  -p 50080:80 \
  -p 50022:22 \
  --name gitlab \
  --restart always \
  -v /data/gitlab/config:/etc/gitlab \
  -v /data/gitlab/logs:/var/log/gitlab \
  -v /data/gitlab/data:/var/opt/gitlab \
  -v /etc/localtime:/etc/localtime \

I can access it after installation via

For the runner, I follow the instruction from gitlab, and installed it in a KVM machine:

# Download the binary for your system
sudo curl -L --output /usr/local/bin/gitlab-runner

# Give it permission to execute
sudo chmod +x /usr/local/bin/gitlab-runner

# Create a GitLab Runner user
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

# Install and run as a service
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start

And registered it:

sudo gitlab-runner register --url --registration-token GR1348941zXXXXX

And with config.toml:

$ sudo cat /etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0
shutdown_timeout = 0

  session_timeout = 1800

  name = "gitlab runner in kvm"
  url = ""
  id = 1
  token = "GR1348941zXXXXX
  token_obtained_at = 2023-03-27T07:47:27Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"

  name = "ub01"
  url = ""
  id = 2
  token = "m-wUqDXXXXX"
  token_obtained_at = 2023-03-28T02:22:53Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
    MaxUploadedArchiveSize = 0

But got errors when running CI:

Running with gitlab-runner 15.10.0 (456e3482)
  on ub01 m-wUqDPy, system ID: s_e36d739109b2
Preparing the "shell" executor
Using Shell (bash) executor...
Preparing environment
Running on ub01...
Getting source from Git repository
Fetching changes with git depth set to 20...
Initialized empty Git repository in /home/gitlab-runner/builds/m-wUqDPy/0/dev/tests/.git/
Created fresh repository.
fatal: repository '' not found
ERROR: Job failed: exit status 1


I did try to change the external_url field in gitlab.rb, but then gitlab web page failed to load.

external_url ''

According to GitLab Runner : Failing to clone repository: gitlab running @ Custom port - #2 by ariel.barria

Now it works by adding clone_url.