subuser icon indicating copy to clipboard operation
subuser copied to clipboard

Changes made to home directory in SubuserImagefile are lost

Open mad-s opened this issue 8 years ago • 1 comments

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

mad-s avatar May 24 '17 19:05 mad-s

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.

timthelion avatar May 24 '17 20:05 timthelion