concourse / docker-image-resource

a resource for docker images
Apache License 2.0
165 stars 258 forks source link

docker.pkg.github.com support? #285

Open yelizariev opened 4 years ago

yelizariev commented 4 years ago

It seems, that the image is uploaded, but then an error happens on trying to pull the image. Context is below.

My pipeline config is something like this:

resources:
# ...
- name: docker-registry
  type: docker-image
  source:
    repository: docker.pkg.github.com/it-projects-llc/hound/pr
    username: ((github-username))
    password: ((github-token))

jobs:
# ....
  - put: docker-registry
    params:
      build: pr
      dockerfile: pr/DockerfilePR
      tag_file: pr-info/tag.txt

screenshot-ci 8080 yelizariev dev it-projects info-2019 11 23-19_14_29

When I try to pull locally, the command does not work:


$ docker pull docker.pkg.github.com/it-projects-llc/hound/pr@sha256:4c836c350d9f38061f96428228bd26f672afca7c6e3f48d486101bc45783af49
Error response from daemon: manifest for docker.pkg.github.com/it-projects-llc/hound/pr@sha256:4c836c350d9f38061f96428228bd26f672afca7c6e3f48d486101bc45783af49 not found

But it does works with the tag. And you can see that the downloaded tag has the same sha:

$ docker pull docker.pkg.github.com/it-projects-llc/hound/pr:pr-8-head-e520d7f-base-33f8705 
pr-8-head-e520d7f-base-33f8705: Pulling from it-projects-llc/hound/pr
89d9c30c1d48: Already exists 
7196c122958a: Already exists 
c374e3dd66a7: Already exists 
585ea8360d37: Already exists 
10e1bd8c3dd3: Already exists 
6e0205926582: Already exists 
56d962d43dca: Pull complete 
0aa135f6d7bb: Pull complete 
Digest: sha256:4c836c350d9f38061f96428228bd26f672afca7c6e3f48d486101bc45783af49
Status: Downloaded newer image for docker.pkg.github.com/it-projects-llc/hound/pr:pr-8-head-e520d7f-base-33f8705
yelizariev commented 4 years ago

Is there a workaround for this?

yelizariev commented 4 years ago

Ok, the workaround is simple:

 - get_params:
     skip_download: true
xtremerui commented 4 years ago

Seems like it is the expected behaviour of docker.pkg.github.com that you can only pull an image by tag but not sha. And Thx for the workaround!

qvistgaard commented 4 years ago

This apparently also breaks resources-types from being read from GitHub. Is there a any update on this issue?

xtremerui commented 4 years ago

@qvistgaard refer to the link in my previous comment. Could you use tag when config the resource-types?