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

Use docker labels rather than statically defined configs #3

Closed
Leopere opened this issue Jun 10, 2019 · 7 comments
Closed

Use docker labels rather than statically defined configs #3

Leopere opened this issue Jun 10, 2019 · 7 comments

Comments

@Leopere
Copy link

Leopere commented Jun 10, 2019

Referenced feature in #1 and #2

@moqmar
Copy link

moqmar commented Oct 3, 2019

So, I'd suggest the following labels:

  • -l diun just checks for Config.Image (so, the tag the container has been started with)
  • -l diun='^1\.2\..*' enables watch_repo & checks for the matching tags (like include_tags)
  • -l diun='1.2.*' - why not use wildcards if the tag name is valid except for the wildcard? This is also relevant for include_tags...
  • -l diun=true is like -l diun
  • -l diun=false disables diun explicitly

I'd also add to the watch config section:

watch:
  docker: true # or a path to the Docker socket
  unlabeled-containers: true # also watch unlabeled containers?
  stopped-containers: true # also watch stopped containers?

If that's fine, I can create a pull request for that. 🙃

@crazy-max
Copy link
Owner

Hi @moqmar,

Thanks for your suggestions!

I would prefer to work with fields. This way we could easily serialize to the same struct as the current static configuration:

  • diun.enable=true/false
  • diun.watch_repo=true/false
  • diun.max_tags=0
  • diun.include_tags.one=^1\.2\..*
  • diun.include_tags.other=latest
  • diun.exclude_tags.foo=^1\.2\..*
  • diun.exclude_tags.bar=latest

diun.include_tags/exclude_tags is a map here.

What do you think? Anyway feel free to open a PR :)

@moqmar
Copy link

moqmar commented Oct 11, 2019

Hm, I think having both possibilities would be great, so it's possible to "just enable diun" with a single-word-label, but also to directly configure it for more advanced options. I'll try to put something together. :)

@crazy-max
Copy link
Owner

@moqmar Of course, I was just stating all the labels and there will be default values.

@Leopere
Copy link
Author

Leopere commented Oct 11, 2019

Glad to see this is still progressing in some way. My biggest concern with running containers is that you don't typically see any update notifications anywhere. You can use things like Ouroboros and the other one I've forgotten but that's assuming that all containers are created equal and sadly this is not the case. Sometimes you just use a container because it's the only one reliable enough to deploy.

At least being notified will make a big difference.

moqmar added a commit to moqmar/diun that referenced this issue Oct 12, 2019
@crazy-max crazy-max changed the title FeatureRequest: Can we use docker labels rather than statically defined configs? Use docker labels rather than statically defined configs Nov 19, 2019
crazy-max added a commit that referenced this issue Dec 14, 2019
@crazy-max crazy-max mentioned this issue Dec 14, 2019
@crazy-max
Copy link
Owner

crazy-max commented Dec 14, 2019

@Leopere Done through release 2.0.0

@Leopere
Copy link
Author

Leopere commented Dec 15, 2019

Oh, that's very nice thank you! I'm looking forward to plugging this thing into my entire docker stack!

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

No branches or pull requests

3 participants