Gitlab Runner无法解析主机:gitlab.com

时间:2018-07-31 08:14:29

标签: git docker gitlab raspberry-pi3

我目前正在Raspberry Pi(3B +)上运行Gitlab Runner。我从下面的config.toml开始:

[[runners]]
  name = "gitlab-runner-pi"
  url = "https://gitlab.com"
  token = "XXXXXXX"
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "alpine:latest"
    privileged = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0
  [runners.cache]

我也在我的gitlab存储库中注册了它,它在线且正在运行。

但是每当我开始构建时,就会发生这种情况:

Running with gitlab-runner 11.1.0 (081978aa)
  on gitlab-runner-pi c2292b01
Using Docker executor with image java:8-jdk ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:61cb6998bd37f6fddf8ad9da28d37b8fbbe74e5a25a159a76d02cdfa5a21c429 for docker:dind ...

Cloning repository...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.com/my-project.git/': Could not resolve host: gitlab.com

您还可以看到我的gitlab-ci.yml:

image: java:8-jdk

stages:
  - build
  - package

before_script:
  - export GRADLE_USER_HOME=`pwd`/.gradle
  - docker info

cache:
  paths:
    - .gradle/wrapper
    - .gradle/caches
build:
  stage: build
  script:
    - ./gradlew build
  artifacts:
    paths:
      - build/libs/*.jar
    expire_in: 1 week
  only:
    - master

docker-build:
  image: docker:stable
  services:
   - docker:dind
  stage: package
  script:
    docker build -t registry.gitlab.com/my-project .
    docker push registry.gitlab.com/my-project

after_script:
  - echo "End CI"

我认为这是一个网络问题,因为我发现了关于SO的多个建议,但是到目前为止,没有一个建议在起作用。我已经尝试过the gitlab_default的网络模式。

谢谢您的帮助。

0 个答案:

没有答案