Docker 中 Gitlab Runner 安装 Docker

Docker 中 Gitlab Runner 安装 Docker

好吧,我正在尝试安装、注册并成功使用 Gitlab Runner 作为 docker 中的容器,使用执行程序 docker,基本上就是 docker in docker。我遇到了一些问题,但我能够自己解决。

我在同一主机下的另一个容器中运行 gitlab-ce,但发生了这种情况,我提交了一个使用 gradle 的 java 应用程序。

当项目由 gitlab-runner “运行”时,它会输出以下内容:

Running with gitlab-runner 11.1.0 (081978aa)
  on 22a4f0fe15d9 f13579e3
Using Docker executor with image docker:stable-git ...
Starting service docker:stable-dind ...
Pulling docker image docker:stable-dind ...
Using docker image sha256:07209cbca312e673f234f13ebd01d69072bf9c769a30e1b8a489724733ad6300 for docker:stable-dind ...
Waiting for services to be up and running...
Pulling docker image docker:stable-git ...
Using docker image sha256:bbe92802c022026ee14a9c72299de3e5025585d078ea61e83eb5bf2178f86bec for docker:stable-git ...
Running on runner-f13579e3-project-2-concurrent-0 via 97065b15f749...
Fetching changes...
HEAD is now at 4cd0975 Update LICENSE.md
warning: redirecting to https://git.example.com:443/PhysiOS/someproject.git/
Checking out 4cd0975e as master...
Skipping Git submodules setup
$ # Auto DevOps variables and functions # collapsed multi-line command
$ setup_docker
$ build
Logging to GitLab Container Registry with CI credentials...
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password
ERROR: Job failed: exit code 1

我正在使用专用服务器运行 Ubuntu 18.04,有任何想法如何解决这个问题,因为我甚至不知道这里出了什么问题。

所以从我的理解来看,它与命令有关,docker login所以我手动尝试并得到了这个:

root@MyServer / # docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: User
Password: 
Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`

docker info输出:

Containers: 2
 Running: 2
 Paused: 0
 Stopped: 0
Images: 2
Server Version: 18.06.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d64c661f1d51c48782c9cec8fda7604785f93587
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-29-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.28GiB
Name: MyServer
ID: redacted
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 registry.example.com
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

如果我修复“存储凭据错误”并登录,它是否也会修复 gitlab-runner 的问题?

注意:我使用的 gitlab-runner 镜像是 dockerhub 上的官方镜像gitlab/gitlab-runner

如果您需要任何其他信息,请发表评论,我会很乐意提供...

相关内容