Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: allow to list tags/IDs of remote image #14254

Open
miminar opened this issue Jun 29, 2015 · 13 comments
Open

Proposal: allow to list tags/IDs of remote image #14254

miminar opened this issue Jun 29, 2015 · 13 comments
Labels
area/distribution kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Comments

@miminar
Copy link
Contributor

miminar commented Jun 29, 2015

As a Docker user, I'd like to be able to list tags and Image IDs of remote images without downloading binary blobs.

Possible interface

Add -l flag to docker tag denoting list tags. If given name matches local image, its tags will be listed. Otherwise a remote registry will be listed.

Example:

docker tag -l docker.io/fedora
REPOSITORY          TAG                 IMAGE ID
fedora              20                  d7f0e75cf11fd6fe9fc3e676bb423f1504ea20da110d4d480f74cda8cb94f574
fedora              21                  e26efd418c4841f7299832fe7689de3e820d91a16bb4cff5b72eb9b09d712753
fedora              22                  ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4
fedora              heisenbug           d7f0e75cf11fd6fe9fc3e676bb423f1504ea20da110d4d480f74cda8cb94f574
fedora              latest              ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4
fedora              rawhide             f62b946038358811c82b9ce50601674a7e1b52ee742557429f244415064251b6
@miminar miminar changed the title Allow to list tags/IDs of remote image Proposal: allow to list tags/IDs of remote image Jun 29, 2015
@jessfraz jessfraz added kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny and removed kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny kind/proposal labels Sep 8, 2015
@steelbrain
Copy link

A friendly bump, this would be nice to see implemented in docker soon

@andyxning
Copy link

@steelbrain Any updates on this?

@steelbrain
Copy link

@andyxning Not that I am aware of :(

@olalonde
Copy link

olalonde commented Jun 16, 2017

Does anyone know a work around? As part of a CI/CD script, I'm trying to avoid building an image if it's already in my AWS ECR repository. I'm using the git short version to tag images.

@Hossrod
Copy link

Hossrod commented Jun 19, 2017

Would really like to see this as well. Work around for us has been to use the Docker Hub API. For example, doing a GET on https://index.docker.io/v1/repositories/<namespace>/<repo_name>/tags returns json array with list of tags.

@olalonde
Copy link

I ended up writing this script (for AWS ECR) as a work around: https://gist.github.com/36a7e8b70769fb87c0d037ff01fb4e91

@outofcoffee
Copy link

Here's a variant of the script that checks ECR using the AWS CLI: https://gist.github.com/outofcoffee/8f40732aefacfded14cce8a45f6e5eb1

@miminar
Copy link
Contributor Author

miminar commented Mar 15, 2018

@demofly
Copy link

demofly commented May 14, 2018

Oneliner for CI/CD in my GCP/GCR env:

gcloud container images list-tags --filter="tags=(master)" --format="table[no-heading](digest)" "eu.gcr.io/ci-test-env/system-nginx-ci-lb"

It returns digest or empty data to stdout for image "eu.gcr.io/ci-test-env/system-nginx-ci-lb:master"

Or, we can return count of images with tag. 0 will mean not found:

function docker_image_exists()
{
  TAG=$(echo "$1" | sed -r 's#^.*:([^:]+)$#\1#')
  URL=$(echo "$1" | sed -r 's#^[^:/]*://##' | sed -r 's#:([^:]+)$##')
  gcloud container images list-tags --filter="tags=(${TAG})" --format="table[no-heading](digest)" "${URL}" | wc -l
}

docker_image_exists "https://eu.gcr.io/ci-test-env/system-nginx-ci-lb:master"

@paologallinaharbur
Copy link

any update?

@Miserlou
Copy link

Please update this. There is so much copypasta garbage out there about checking the URL response from the API using bash. Make this is a native feature!

@irfanbaigse
Copy link

still waiting

@thaJeztah
Copy link
Member

related docker/roadmap#117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/distribution kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
None yet
Development

No branches or pull requests