Giter VIP home page Giter VIP logo

Comments (13)

oryband avatar oryband commented on August 21, 2024

@doodyparizada

from dockerize.

oryband avatar oryband commented on August 21, 2024

i understand now that i was missing the app to be executed after the template finished processing.
the help line is a little misleading:

$ dockerize -h
Usage of dockerize:
  -delims string
        template tag delimiters. default "{{":"}}"
  -stderr value
        Tails a file to stderr. Can be passed multiple times
  -stdout value
        Tails a file to stdout. Can be passed multiple times
  -template value
        Template (/template:/dest). Can be passed multiple times
  -version
        show version
  • i'm missing an "how to execute" line at the top of the help file
  • also, i'd like to have a way to just generate a template without executing anything

from dockerize.

oryband avatar oryband commented on August 21, 2024

Right now I'm bypassing this by passing true to the app part of the command, practically making dockerize execute a no-op:

$ docker -template x:y true && my_app
# instead of doing this, which is undesirable in my case:
$ docker -template x:y my_app

However, this is a hack. This is sometimes necessary because letting dockerize execute the app can sometimes create problems and errors. For example when SIGTERMing.

It feels like dockerize is trying to achieve two things at once, instead of going the unix way: Splitting the features into two separate tools, which can be bundled together if necessary. wdyt?

from dockerize.

jwilder avatar jwilder commented on August 21, 2024

@oryband I think some kind of a -dry-run feature would be useful. Good idea.

from dockerize.

jwilder avatar jwilder commented on August 21, 2024

The no command specified could be improved as well.

from dockerize.

doodyparizada avatar doodyparizada commented on August 21, 2024

I know it's not backward compatible, but I would prefer that dockerize's default behaviour would be to not expect a command be given (i.e. default -dry-run) so it just renders the template. If you want to give a command, you would have to specify --command="XXX XXX"

from dockerize.

jwilder avatar jwilder commented on August 21, 2024

@oryband I've updated the usage as well as made command optional as well.

@doodyparizada Command is not optional. You can render templates to standard output for debugging by leaving off the :/dest portion.

from dockerize.

oryband avatar oryband commented on August 21, 2024

@jwilder thanks!

however, I think adding an example of the hack I did above is a good idea (providing true as a command). Some people (like myself) would only like to use the templating feature of dockerize, without the execution part. If we're keeping the command as required, we should at least provide an example how to bypass it.

from dockerize.

md5 avatar md5 commented on August 21, 2024

@oryband It sounds like you may be better off using jwilder/docker-gen instead of dockerize.

from dockerize.

oryband avatar oryband commented on August 21, 2024

@md5 I did at first, but it requires mounting the docker socket file in order to fetch environment variables. This is kinda overkill for the purpose of templating.

There is no other golang cli template tool available beside these two tools.

from dockerize.

md5 avatar md5 commented on August 21, 2024

@md5 You're right. That was a silly suggestion on my part.

from dockerize.

oryband avatar oryband commented on August 21, 2024

@md5 why are you talking to yourself? :)

from dockerize.

md5 avatar md5 commented on August 21, 2024

Why not achieve maximum silliness?

from dockerize.

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.