-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Passing --init to docker run #2719
Comments
@hynek Would love a PR for this! |
So I did some research, because I just couldn’t find the But then I found a clue in https://docs.docker.com/engine/reference/run/
With some experimenting I found out that Do you have any guidance on whether/how this could be implemented in Nomad? |
Wouldn't it make sense to be able to pass an array of custom docker run args instead of implementing every single one? similar to arsg[] for command. |
redacted brain fart |
Wait no never mind I got confused for a minute. The "problem" is that nomad never passes any CLI args to docker, it uses its API. And certain args sadly aren't exposed by the API. --init being one of them. |
I understand, in that case there's no other choice than implementing all the stuff. |
Looks like https://docs.docker.com/engine/api/v1.39/#operation/ContainerCreate indicates this is passable as part of the API now in recent docker engines. |
Any word on adding support for this? Because node.js requires this flag to properly handle external signals, we're running into it as a limitation. |
FWIW, until it gets fixed, it's quite easy to simulate. You just add something like this to your base images: # Add Tini
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
# Run your program under Tini
CMD ["/your/program", "-and", "-its", "arguments"]
# or docker run your-image /your/program ... |
To add to @hynek's comment. If you use Alpine Linux (latest stable 3.9) as your base image you get |
@hynek curious, could we just leverage Nomad artifact to download it and use entrypoint + cmd in the job pointing to the artifact? |
@tgross Will this be a feature anytime in nomad roadmap ? |
This will ship in Nomad v1.2.0! |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
As of Docker 1.13, tini is part of docker engine. All you got to do it pass
--init
todocker run
.I think this would be very useful to support in Nomad, especially because it’s a common trap many people walk into (I’d even argue to make it default eventually).
Any chance of adding it? I understand you’re using the API and the bindings for that option might be missing?
The text was updated successfully, but these errors were encountered: