Add workingDir parameter to DockerApp #29
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Docker containers run by default under /. Additionally, when we ensure
and create a new user in the container, we run under /home/r ("r" is the
new user). Both of these options make it impossible to retrieve anything
from the working directory after execution finishes though, which is why
we need a new parameter that lets users specify under which directory
the container command will run (and thus they can also map it from the
host system).
This commit adds support for a new workingDir parameter in DockerApps.
Its value defaults to "/", and is only taken into account when the image
from which the container is started doesn't already contain a value for
its WorkingDir specification. We take care that this preference is
obeyed both when we internally create a new user, as well as when we
don't A new unit test checks that this is working as expected.
This work is part of LIU-53.
Signed-off-by: Rodrigo Tobar rtobar@icrar.org