hobbit-project / platform

HOBBIT benchmarking platform
GNU General Public License v2.0
24 stars 9 forks source link

Docker client needs authentication to access protected or private images #2

Closed MichaelRoeder closed 7 years ago

MichaelRoeder commented 7 years ago

The Platform can not pull benchmark or system images that are protected or private in Gitlab.

2017-03-14 10:13:15,330 INFO [com.spotify.docker.client.LoggingPullHandler] - <pull git.project-hobbit.eu:4567/XXXXX:latest: ProgressMessage{id=hobbit-worker5, status=Pulling git.project-hobbit.eu:4567/XXXXX:latest..., stream=null, error=null, progress=null, progressDetail=ProgressDetail{current=0, start=0, total=0}}>
...
2017-03-14 10:13:15,525 INFO [com.spotify.docker.client.LoggingPullHandler] - <pull git.project-hobbit.eu:4567/XXXXX:latest: ProgressMessage{id=hobbit-worker5, status=Pulling git.project-hobbit.eu:4567/XXXXX:latest... : Error response from daemon: Get https://git.project-hobbit.eu:4567/v2/XXXXX/manifests/latest: denied: access forbidden, stream=null, error=null, progress=null, progressDetail=ProgressDetail{current=0, start=0, total=0}}>

The Docker client used in the platform needs credentials to pull non-public images. It is not sufficient to give these credentials to the Docker daemon that is used by the client.

Solution: provide credentials via environmental variables that are used by the Docker client.

MichaelRoeder commented 7 years ago

The Problem is hard to reproduce without docker swarm.

Using a local docker instance, the error printed out is

platform-controller_1  | 2017-03-15 12:40:48,046 ERROR [org.hobbit.controller.docker.ContainerManagerImpl] - <
Exception while pulling the image "git.project-hobbit.eu:4567/gitadmin/platform-benchmark:latest". 
com.spotify.docker.client.exceptions.DockerRequestException: Request error: 
POST unix://localhost:80/images/create?fromImage=git.project-hobbit.eu:4567/gitadmin/platformbenchmark&tag=latest: 500>
MichaelRoeder commented 7 years ago

fixed in v1.0.1