Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.92k stars 397 forks source link

denied: access forbidden with draft up #912

Closed eimarfandino closed 5 years ago

eimarfandino commented 5 years ago

I am getting an access forbidden when dling a draft up. It seems that draft is not using the docker credentials stored in the docker config file.

Login works:

⤷ docker login -u efandino registry.gitlab.internal.com
Password:
Login Succeeded

Draft up fails:

⤷ draft up
Draft Up Started: 'my-test-image': 01CYK5Y6A3X3WW8JVQJ88RSM8M
my-test-image: Building Docker Image: FAIL ❌  (2.0021s)
Inspect the logs with `draft logs 01CYK5Y6A3X3WW8JVQJ88RSM8M`

Access denied?

⤷ draft logs
Step 1/20 : FROM registry.gitlab.internal.com/docker/builder-java:0.4.3 AS BUILD
2018/12/13 08:01:52 error while building: Get https://registry.gitlab.internal.com/v2/docker/builder-java/manifests/0.4.3: denied: access forbidden

I can pull, so it seems draft is not using the same credentials?

⤷ docker pull registry.gitlab.internal.com/docker/builder-java:0.4.3
0.4.3: Pulling from docker/builder-java
Digest: sha256:cb51f3aeeebb2a3869e395ff275f0533459c95c26458557cb87c71875db5c00d
Status: Downloaded newer image for registry.gitlab.internal.com/docker/builder-java:0.4.3

Is this an issue with authentication or an issue with draft using v2 of the registry api?

eimarfandino commented 5 years ago

I have been digging in into this issue and i found out that in the class builder.go the ImageBuild do not pass the authentication options. Therefore is in your Dockerfile a pull from a private repo needs to happen this will throw the denied: access forbidden.

squillace commented 5 years ago

hey, thanks for bringing this up. Today's all about trying to find our way home from kubecon, but we're here! and thanks for the PR. :-) @radu-matei @bacongobbler

eimarfandino commented 5 years ago

thanks @squillace. Merge request is ready to be reviewed: https://github.com/Azure/draft/pull/914

eimarfandino commented 5 years ago

@squillace @radu-matei @bacongobbler Can you guys please take a look to this issue?

squillace commented 5 years ago

our bad. thanks for the re-up. @radu-matei or @bacongobbler have a quick look at this? I'd sorta like it to work, too. :-)

eimarfandino commented 5 years ago

@squillace do you know what are the release expectations? Would like to have this fix in the released version.