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

Changes made to home directory in SubuserImagefile are lost #322

Open
mad-s opened this issue May 24, 2017 · 1 comment
Open

Changes made to home directory in SubuserImagefile are lost #322

mad-s opened this issue May 24, 2017 · 1 comment

Comments

@mad-s
Copy link
Contributor

mad-s commented May 24, 2017

OS: Linux 4.11.1-gentoo, Docker Version 17.03.1-ce, Subuser 0.6.1 (master branch)

This happens regardless whether or not the subuser has 'stateful-home' permission or not.

Sample image file:

FROM debian:testing
WORKDIR /home/subuser
RUN echo Test > file
RUN rev file      # correctly outputs tseT

Expected behavior: /home/subuser/file exists inside container, having been chowned to the subuser user
Actual behavior: /home/subuser is empty

@timthelion
Copy link
Contributor

I've run into this before, and my solution has always to be to change the "executable" to a script that autocreates anything that needs to be created. With stateful-home turned on, this is expected behavior, as we are bindmapping a volume onto /home/subuser and that is covering up the version of the home dir that you have created in the image build script.

https://github.com/subuser-security/subuser/blob/master/logic/subuserlib/classes/subuserSubmodules/run/runtime.py#L141

This shouldn't happen, however, with stateful-home turned off. I think that what you're actually seeing, is the poor UX of having basic-common-permissions over-ride whatever you've set stateful-home to. That is, if basic-common-permissions is true, but stateful-home is false, subuser still behaves as if the home dir were stateful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants