Git Product home page Git Product logo

Comments (4)

beorn7 avatar beorn7 commented on July 19, 2024

I doubt this will be seen by the right audience. Maybe it's more a request for the maintainers of the snap packages?

from prometheus.

orfeas-k avatar orfeas-k commented on July 19, 2024

@beorn7 Sorry maybe it wasn't clear. Snap is behaving as I would expect it to behave while the docker image is the one "misbehaving" here.

from prometheus.

dgl avatar dgl commented on July 19, 2024

This isn't really anything to do with the Docker image either, overriding --entrypoint on the Docker command line is tricky to get right, particularly as Docker supports a JSON format for multiple arguments in the Dockerfile, but not on the command line.

With:

docker run -v $PWD:/charm --entrypoint "/bin/promtool" prom/prometheus:latest 'check rules /charm/src/prometheus_alert_rules/*.rule'

The entire argument of check rules /charm/src/prometheus_alert_rules/*.rule is being passed as one argument, with no shell parsing it. For the globs to work a shell needs to be involved.

My suggestion to make globbing work as you expect is to map in the same path on the host as the container, i.e.:

docker run -v $PWD:$PWD --entrypoint "" prom/prometheus:latest promtool check rules $PWD/*.rule
Checking /home/dgl/foo.rule
  SUCCESS: 0 rules found

Then the globbing happens outside the container. This approach will continue working in the future as we may stop shipping a shell inside the container (i.e. use "distroless" containers).

from prometheus.

beorn7 avatar beorn7 commented on July 19, 2024

Looks like this is a usage question. I'll convert it to a discussion so that it stays around to help others.

from prometheus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.