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

"no command specified" on every command #13

Closed
oryband opened this issue Oct 22, 2015 · 13 comments
Closed

"no command specified" on every command #13

oryband opened this issue Oct 22, 2015 · 13 comments

Comments

@oryband
Copy link

oryband commented Oct 22, 2015

running this inside an ubuntu latest image:

$ dockerize -template x:y
2015/10/22 07:13:12 no command specified
$ dockerize -stderr x
2015/10/22 07:13:50 no command specified
# this goes on for everything i do, except -version which does seem to work

any idea what is wrong? the output is really unhelpful

@oryband
Copy link
Author

oryband commented Oct 22, 2015

@doodyparizada

@oryband oryband changed the title "no command specified" no matter what i do "no command specified" on every command Oct 22, 2015
@oryband
Copy link
Author

oryband commented Oct 22, 2015

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

@oryband
Copy link
Author

oryband commented Oct 22, 2015

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?

@jwilder
Copy link
Owner

jwilder commented Oct 22, 2015

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

@jwilder
Copy link
Owner

jwilder commented Oct 22, 2015

The no command specified could be improved as well.

@doodyparizada
Copy link

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"

@jwilder
Copy link
Owner

jwilder commented Oct 27, 2015

@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.

@jwilder jwilder closed this as completed Oct 27, 2015
@oryband
Copy link
Author

oryband commented Nov 1, 2015

@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.

@md5
Copy link

md5 commented Nov 2, 2015

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

@oryband
Copy link
Author

oryband commented Nov 3, 2015

@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.

@md5
Copy link

md5 commented Nov 3, 2015

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

@oryband
Copy link
Author

oryband commented Nov 4, 2015

@md5 why are you talking to yourself? :)

@md5
Copy link

md5 commented Nov 4, 2015

Why not achieve maximum silliness?

apollo13 pushed a commit to apollo13/dockerize that referenced this issue Dec 30, 2018
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

4 participants