crops / poky-container

A container image that is able to run bitbake/poky. It has helpers to create users and groups within the container. This is so that the output generated in the container will be readable by the user on the host.
GNU General Public License v2.0
206 stars 94 forks source link

poky-entry: make compatible with standard docker invocation #34

Closed andred closed 4 years ago

andred commented 5 years ago

This had two issues:

Both are non-standard behaviour, and in particular conflict with the Jenkins docker plugin's expected use of docker images, as that relies on standard behaviour.

We now:

Signed-off-by: André Draszik andre.draszik@jci.com

rewitt1 commented 5 years ago

Hi @andred,

In your commit message you say "This had two issues:", what is this?

Also if you give an example command line using the poky-container using "standard docker invocation" which is what you desire, vs. what you are considering non-standard, it will help me understand.

andred commented 5 years ago

Hi @rewitt1,

'this' in the first sentence refers to poky-entry.py in particular, but more generally how this image expects itself to be started.

A normal docker run command line would be e.g (adopted from the runtests.sh script, which I have forgotten to modify in my patch): docker run --rm -v $LOCAL_WDIR:/workdir:Z --workdir=/workdir $IMAGE "/workdir/$i" whereas this image wants to be started as docker run --rm -v $LOCAL_WDIR:/workdir:Z $IMAGE --workdir=/workdir --cmd="/workdir/$i" i.e.:

The problem with that is:

Does this make it more clear? If yes, I'll update the commit message (and also update the runtests.sh script)

rewitt1 commented 5 years ago

Yes I understand.

Originally, I didn't want anyone to be able to use the container as a general purpose container for running arbitrary commands. The reasoning behind that was so that if a user said "The container isn't working", I wouldn't ever have to worry about commands that didn't use the entry point. The "--cmd" argument was intended for testing only.

However, if it is useful for you to be able to run arbitrary commands, such as a script to run bitbake similar to runbitbake.py, then this change makes sense.

I'll add my questions about the changes to the review.

rewitt1 commented 4 years ago

@andred, If you're wondering why I force pushed to your branch, its because I tried using the github web editor to fix a merge conflict, and it replaced the original commit with the merge commit. I'm really not sure what happened.

The new commit that I pushed to your branch, is your original commit with the merge conflict fixes. I wanted to make sure you got credit and the history stayed around.