ehough/docker-kodi

--homedir is used but it is nowhere defined

janvda opened this issue · 4 comments

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.

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?

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.

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

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.