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

--homedir is used but it is nowhere defined #33

Open
janvda opened this issue Apr 11, 2020 · 4 comments
Open

--homedir is used but it is nowhere defined #33

janvda opened this issue Apr 11, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@janvda
Copy link

janvda commented Apr 11, 2020

The readme file mentions the following example using --homedir

$ x11docker --xorg                                 \
            --pulseaudio                           \
            --gpu                                  \
            --homedir /host/path/to/kodi/home      \
            -- -v /host/path/to/media:/media:ro -- \
            erichough/kodi

I have searched a lot but I couldn't find any documentation for option --homedir

I am especially asking this as I want to make use of docker volumes instead of hardcoded host paths.

@mviereck
Copy link

Option --homedir is deprecated and replaced by --home=DIR.
Compare:

Shared folders:
 -m, --home [=DIR]     Share a host folder as home folder in container to store
                       persistent data. Uses ~/.local/share/x11docker/IMAGENAME.
                       Optionally specify another host folder DIR.
                       ( ~/.local/share/x11docker has a softlink to ~/x11docker.
                        Use --homebasedir to change the base storage folder.)
     --share PATH      Share host file or folder PATH. Read-only with PATH:ro
                       Device files in /dev can be shared, too.

Option --home is not designed to use docker volumes yet. How would you specify a volume?

@ehough ehough added the bug Something isn't working label Apr 12, 2020
@ehough
Copy link
Owner

ehough commented Apr 12, 2020

Thanks for the report - I will update the docs to match the latest x11docker params.

@mviereck thanks as always for your support!

How would you specify a volume?

Just my two cents - perhaps if the value of --home does not contain directory separators, x11docker would try to interpret that as a volume name. e.g. --home mycoolvolume would refer to a volume, whereas --home my/cool/volume would be interpreted as a filesystem path. There could be plenty of problems with this approach, but I thought I'd throw it out there.

@mviereck
Copy link

mviereck commented Apr 12, 2020

I've never used docker volumes and do my first steps now.

Just my two cents - perhaps if the value of --home does not contain directory separators, x11docker would try to interpret that as a volume name.

That sounds like a good approach.

I've just tested it with current x11docker (without a change).
What happens yet:

x11docker --home=testvolume x11docker/xfce xfce4-terminal
  • x11docker creates a folder testvolume in pwd. (Not nice, should be checked.)
  • docker creates a volume testvolume instead of using the created folder. (So far, using a volume already works.)
  • Issue: testvolume is owned by root. The unprivileged container user cannot write into its HOME. A touch testfile fails with "permission denied".

The path vs. volume confusion can be solved easily with a check for / as suggested by @ehough.

I am not sure yet how to solve the ownership issue. x11docker could create a subfolder in the volume owned by the user.
Pro: similar to /home/username where /home is owned by root.
Contra: The home folder is not exactly the one specified with --home=VOLUME. This behaviour would differ from --home=/absolute_path:

  • --home=/absolute_path -> HOME=/absolute_path
  • --home=volume -> HOME=/volume/username

mviereck added a commit to mviereck/x11docker that referenced this issue Apr 12, 2020
@mviereck
Copy link

mviereck commented Apr 12, 2020

I've added docker volume support for options --home and --share.
I hope that I did not introduce new bugs.

Shared host folders or Docker volumes:
 -m, --home [=ARG]     Create a persistant HOME folder for data storage.
                       Default: Uses ~/.local/share/x11docker/IMAGENAME.
                       ARG can be another host folder or a docker volume.
                       (~/.local/share/x11docker has a softlink to ~/x11docker.)
                       (Use --homebasedir to change this base storage folder.)
     --share ARG       Share host file or folder ARG. Read-only with ARG:ro
                       Device files in /dev can be shared, too.
                       ARG can also be a docker volume instead of a host folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants