#StackBounty: #ubuntu #docker #gitlab #continuous-integration #docker-registry Gitlab Runner, Docker in Docker, Gitlab CI Registry not …

Bounty: 100

Alright, so I am trying to install, register and successfully use a Gitlab Runner as a container in docker with the executor docker, basically docker in docker. I had some problems with it but was able to solve them on my own.

I am running gitlab-ce in another container under the same host but this happens, I commited a java aplication that uses gradle.

When the project is “ran” by gitlab-runner it outputs this:

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

I am using on a dedicated server running Ubuntu 18.04, any ideas how to fix this because I don’t even know what’s at fault here.

So from my understanding it has something to do with docker login command so I tried it manually and got this:

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
Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`

docker info outputs:

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
 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:
  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/
Experimental: false
Insecure Registries:
Live Restore Enabled: false

WARNING: No swap limit support

If I fix the “error storing credentials” and login will it also fix gitlab-runner’s problem?

Note: the image I was using for gitlab-runner is the official one at dockerhub gitlab/gitlab-runner

If you need any additional information, comment this and I will happily provide it…

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.