English 中文(简体)
gitomb-runner: 未能与当地东道国港口连接 80: 拒绝联系
原标题:gitlab-runner: Failed to connect to localhost port 80: Connection refused

I have gitlab running on docker container. Also, I have gitlab-runner installed on my Cenots7 machine. Runner configured use docker executor.

config.toml

concurrent = 1                                                                                                          
check_interval = 0                                                                                                      


[session_server]                                                                                                        
  session_timeout = 1800                                                                                                

[[runners]]                                                                                                             
  name = "test"                                                                                                         
  url = "http://localhost"                                                                                              
  token = "gQfiiD4PUyPs4TiXLX9-"                                                                                        
  executor = "docker"                                                                                                   
  log_level = "debug"                                                                                                   
  pre_clone_script = "ls -la"                                                                                           
  clone_url = "http://localhost/"                                                                                       
  [runners.docker]                                                                                                      
    tls_verify = false                                                                                                  
    image = "node"                                                                                       
    privileged = false                                                                                                  
    disable_entrypoint_overwrite = false                                                                                
    oom_kill_disable = false                                                                                            
    disable_cache = false                                                                                               
    volumes = ["/cache"]                                                                                                
    shm_size = 0                                                                                                        
    # network_mode = "gitlab_default"                                                                                   
    # pull_policy = "never"                                                                                            
  [runners.cache]                                                                                                       
    [runners.cache.s3]                                                                                                     
    [runners.cache.gcs]

经营人从事工作时,可以“衣帽重”和打印错误:

Cloning repository...
Cloning into  /builds/root/project ...
fatal: unable to access  http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@localhost/root/project.git/ : Failed to connect to localhost port 80: Connection refused
/bin/bash: line 64: cd: /builds/root/project: No such file or directory
ERROR: Job failed: exit code 1

我还尝试:clone_url = “http://172.17.0.1”,但也有同样的错误。

p. from docker executor:

ping 172.17.0.1
PING 172.17.0.1 (172.17.0.1): 56 data bytes
64 bytes from 172.17.0.1: seq=0 ttl=64 time=0.158 ms
64 bytes from 172.17.0.1: seq=1 ttl=64 time=0.090 ms
64 bytes from 172.17.0.1: seq=2 ttl=64 time=0.086 ms
64 bytes from 172.17.0.1: seq=3 ttl=64 time=0.084 ms
64 bytes from 172.17.0.1: seq=4 ttl=64 time=0.086 ms
64 bytes from 172.17.0.1: seq=5 ttl=64 time=0.087 ms
64 bytes from 172.17.0.1: seq=6 ttl=64 time=0.087 ms
64 bytes from 172.17.0.1: seq=7 ttl=64 time=0.109 ms
64 bytes from 172.17.0.1: seq=8 ttl=64 time=0.089 ms
64 bytes from 172.17.0.1: seq=9 ttl=64 time=0.088 ms
64 bytes from 172.17.0.1: seq=10 ttl=64 time=0.098 ms
64 bytes from 172.17.0.1: seq=11 ttl=64 time=0.088 m
问题回答

如果我的案件有帮助的话:

  1. 吉拉布经营人将开办一个临时的拖车集装箱,以完成管道工作。

  2. So, the error Failed access xxx happens in the temporary docker. That explains why you can PING the URL in the gitlab-runner docker container, but get the error.

  3. 最后,我把临时cker车集装箱添加到水泥网中。

    [runners.docker]
    
       network_mode="gitlab_default"
    

    你们可以找到水泥集装箱 in中的网络名称。 对我来说,这是“gitlab_default”。





相关问题
Unable to connect to docker container inside windows server

As title. I am developing a system with many docker images with ASP.Net MVC core projects. I am publishing these docker images into a docker engine installed on Windows Server OS, and I found that I ...

Only can see postgreSQL as an admin

After installed Wsl and Docker, can t access PSQL and other things. I was studying Docker, and installed the latest version. So far so good, I received an error about the WSL version, saw some ...

make docker-compose block until healthy without `depends_on`

I am working with a team that uses docker-compose to start a set of helper services, but does not use docker when the code is being developed. Here, docker-compose is just a convenient way to run the ...

change grafana port using docker host network

I am trying to spin up a grafana container in docker, however my setup in docker does not allow ipv4 forwarding and thus I cannot use the default bridge network in docker. All I can use is the host ...

Pip instalation for Python 3.11 in docker

I have Dockerfile to build image for Django project that uses Python 3.11 and runs in poetry environment (see content below). Problem is when I try to donwload get-pip.py file and run it using Python, ...

在 Dockerfile 中运行 composer install

我正在尝试将我的Laravel应用程序进行Docker化。 该应用程序已经构建并在Git中,但我将vendor文件夹添加到了.gitignore中。 我添加了一个Dockerfile,看起来像这样: FROM php:7.1-fpm-alpine RUN apk update ...

热门标签