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

Add ImageLayers.io Docker Hub layer information service #538

Merged
merged 1 commit into from
Nov 10, 2015
Merged

Add ImageLayers.io Docker Hub layer information service #538

merged 1 commit into from
Nov 10, 2015

Conversation

andyshinn
Copy link
Contributor

This adds a ImageLayers.io badge (which resembles the same data in their own badge). I wanted to use their badge. But it didn't conform to the look of all the other ones I was already using from shields.io.

This also adds a small filesize package. It was a quick way to do humanized file sizes. If this undesirable, I can try and rework it without.

@moul
Copy link

moul commented Sep 19, 2015

👍

method: 'POST',
json: {
"repos": [{"name": path, "tag": tag}]
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe, from request's documentation, that the json entry is meant to either be falsy or true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, my bad. I see now that this should be in the body per docs:

body - entity body for PATCH, POST and PUT requests. Must be a Buffer or String, unless json is true. If json is true, then body must be a JSON-serializable object.

@espadrine
Copy link
Member

Thanks for your contribution!

I cannot get it to work, however. I am not sure what curl to do to test what ought to work, either. Could you help out?

@andyshinn
Copy link
Contributor Author

Sure, I was using something like:

curl -sSL -H 'Content-Type: application/json' -X POST -d '{"repos": [{"name": "library/ubuntu", "tag": "latest"}]}' "https://imagelayers.io:8888/registry/analyze" | jq '.[].repo'

You can remove the `| jq '.[].repo' part if you don't have jq installed.

@espadrine
Copy link
Member

Thanks!

I have two queries.

  1. Usually, we strive to ensure that the left part of the badge reflects what the right part means (eg, coverage, build, downloads, …) What would the most appropriate non-brand description be? "image size" perhaps?
  2. To prepare for the possibility that a particular brand starts producing multiple services, we rely on a prefix. For instance, /imagelayers/image-size/_/ubunutu/latest.svg (adding image-size). Could you add that in (or whatever is more appropriate than image-size)?

@andyshinn
Copy link
Contributor Author

I guess we could have image size and layers as two separate badges. In this case, should the prefix just be image-size and layers respectively?

@espadrine
Copy link
Member

That sounds good!

@andyshinn
Copy link
Contributor Author

Updated to separate into two types image-size and layers.

@@ -0,0 +1 @@
phantomjs_cdnurl=http://cnpmjs.org/downloads
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you detail the purpose of this line?

@espadrine
Copy link
Member

Thanks! Apart from those tangential issues, it seems all good.

@andyshinn
Copy link
Contributor Author

Sorry, those shouldn't have been in the commit. Side note... the PhantomJS npm install doesn't work for me on the default mirror. Could be local issue though.

@espadrine
Copy link
Member

Ah, damned. It it a pinned version on package.json; I'm not sure what is wrong there. I should try to update the project to a newer version of node. Maybe all our worries will evaporate.

@espadrine espadrine merged commit 0c24199 into badges:master Nov 10, 2015
@espadrine
Copy link
Member

Thanks a lot!

I just noticed that the badge says image-size (with a dash). If you want, you can remove the dash as a follow-up PR.

@andyshinn andyshinn deleted the add_imagelayers branch November 10, 2015 18:05
@andyshinn
Copy link
Contributor Author

My JavaScript wasn't up to snuff to elegantly solve that and it didn't bother me enough :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants