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

Add workingDir parameter to DockerApp #29

Merged
merged 1 commit into from
Jul 5, 2021
Merged

Conversation

rtobar
Copy link
Contributor

@rtobar rtobar commented Apr 19, 2021

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

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>
@rtobar rtobar requested a review from awicenec April 19, 2021 06:35
@coveralls
Copy link

coveralls commented Apr 19, 2021

Coverage Status

Coverage increased (+0.07%) to 77.466% when pulling e8dbc6a on liu-53-docker-working-dir into ea54ebb on master.

@awicenec awicenec merged commit 6a3275a into master Jul 5, 2021
@awicenec
Copy link
Contributor

awicenec commented Jul 5, 2021

Works as expected. Merged and closing the ticket as well.

@awicenec awicenec deleted the liu-53-docker-working-dir branch July 5, 2021 11:52
awicenec added a commit that referenced this pull request May 19, 2022
Add workingDir parameter to DockerApp
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

Successfully merging this pull request may close these issues.

None yet

3 participants