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

runCmds are only executable with /bin/sh set #1156

Closed
MeiSign opened this issue Jan 24, 2019 · 2 comments
Closed

runCmds are only executable with /bin/sh set #1156

MeiSign opened this issue Jan 24, 2019 · 2 comments

Comments

@MeiSign
Copy link
Contributor

MeiSign commented Jan 24, 2019

Description

I am trying to create a docker image with RUN parameters and a linux distribution as FROM param, that hasn't linked /bin/sh. Dockerfiles support two RUN syntaxes to set the executable that should your command or to use the standard shell (/bin/sh). (https://docs.docker.com/engine/reference/builder/#run).

When you are in the situation that /bin/sh is not linked you are in a deadlock situation with the plugin. You need a RUN cmd to link the shell but you can't execute the link command.

I can think of two possible solutions:

  1. Extend the runCmd section to support the exec syntax
  2. Support the SHELL param to set a standard shell without linking it per RUN parameter (https://docs.docker.com/engine/reference/builder/#shell)

If I didn't miss something, I can make a pull request if you tell me which of the options you would prefer.

MeiSign added a commit to MeiSign/docker-maven-plugin that referenced this issue Jan 24, 2019
Solves issue fabric8io#1156

Signed-off-by: Stefan Meiwald <st.meiwald@gmail.com>
@MeiSign
Copy link
Contributor Author

MeiSign commented Jan 24, 2019

I have added a pull request with the implementation of the second option.
The runCommands have already the optimise option and I don't wanted to complicate this setting further.

@rhuss
Copy link
Collaborator

rhuss commented Jan 25, 2019

I agree that option 2 is probably simpler (remember, you have always the option to use a plain Dockerfile if advanced Dockerfile options are required).

The PR looks good, with some minor change request (see over there).

rhuss pushed a commit that referenced this issue Apr 5, 2019
* Support docker SHELL setting for runCmds

Solves issue #1156

Signed-off-by: Stefan Meiwald <st.meiwald@gmail.com>

* Use arguments and shell as parent key.
Output always in json format.

Signed-off-by: Stefan Meiwald <st.meiwald@gmail.com>
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

2 participants