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

Enforce Dockerfile labels with lint #102

Open
jml opened this issue May 24, 2017 · 4 comments
Open

Enforce Dockerfile labels with lint #102

jml opened this issue May 24, 2017 · 4 comments

Comments

@jml
Copy link
Contributor

jml commented May 24, 2017

We often have the problem that we don't know where the source code for an image lives.

There's a more-or-less standard way of providing this information, using Docker labels. We should do that.

e.g. https://github.com/weaveworks/weave/blob/master/prog/weaver/Dockerfile.template#L7-L13

LABEL maintainer "Weaveworks Inc <help@weave.works>"
LABEL \
      org.label-schema.name="Weave Net" \
      org.label-schema.description="Weave Net creates a virtual network that connects Docker containers across multiple hosts and enables their automatic discovery" \
      org.label-schema.url="https://weave.works" \
      org.label-schema.vcs-url="https://github.com/weaveworks/weave" \
      org.label-schema.vendor="Weaveworks"
@tomwilkie
Copy link
Contributor

We often have the problem that we don't know where the source code for an image lives.

"Often"? For example?

There's a more-or-less standard way of providing this information, using Docker labels. We should do that.

I wouldn't consider the label-schema.org stuff to be widely accepted or a standard. I'd describe it as something that was started started, that didn't get wide adoption, and that people have now moved on from. For instance, there are only 11 threads on its email list[1], these tags aren't "supported" in anyway by the docker hub, and there are only 1.2k images using them[2].

[1] https://groups.google.com/forum/#!forum/label-schema
[2] https://microbadger.com/labelschema

I much prefer the naming convention approach to solving this problem.

@jml
Copy link
Contributor Author

jml commented May 24, 2017

Examples:

  • a couple of months ago, me trying to find where the code for tomwilkie/git-sync is
  • last month, Paul trying to find where weaveworks/gfdatasource was

A naming convention could work, but the issue is that we have several:

  • name is repo, e.g. weaveworks/kubediff -> github.com/weaveworks/kubediff
  • name is subdir of unmentioned repo, e.g. quay.io/weaveworks/alertmanager -> github.com/weaveworks/monitoring
  • name is subproject of mentioned repo, e.g. quay.io/weaveworks/cortex-alertmanager -> github.com/weaveworks/cortex

At the very least.

@bricef
Copy link

bricef commented Dec 19, 2017

Suggested minimum useful set of labels:

LABEL works.weave.source-path="/grafana/Dockerfile" \
      org.label-schema.schema-version="1.0" \
      org.label-schema.vcs-url="https://github.com/weaveworks/service-conf"

Where works.weave.source-path is the path to the Dockerfile for this image.

@bricef
Copy link

bricef commented Feb 22, 2018

@marccarre has been working on https://github.com/weaveworks-experiments/imagediff to help with this process.

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

No branches or pull requests

3 participants