mviereck / dockerfile-x11docker-deepin

3D desktop deepin from China
MIT License
33 stars 11 forks source link

The behaviour for combined using of "--homebasedir" and "--home" options of x11docker. #23

Closed hongyi-zhao closed 4 years ago

hongyi-zhao commented 4 years ago

I tried to start the container as below:

$ x11docker --homebasedir $HOME --home=x11docker --sudouser -c --desktop --init=systemd -- --cap-add=ALL --security-opt seccomp=unconfined -- hongyi-zhao/deepin-wine startdde

According to my understanding, the host folder $HOME/x11docker will appear in the container, but I don't see the target folder in the container.

Is there a problem with my understanding or usage?

Regards, HY

mviereck commented 4 years ago

Compare x11docker --help:


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.)

   --homebasedir DIR   Custom base folder for option --home.

With --home=x11docker you have specified a docker volume to retain the data. To specify a host folder use an absolute path. --homebasedir only takes effect if you use --home without arguments.

Maybe I should describe this more clearly in x11docker --help.

hongyi-zhao commented 4 years ago

Another problem is the --home option must be assigned with the '= ', i.e., as follows:

--home=~/x11docker

If used without '=', i.e., as follows:

--home ~/x11docker

it will complain as below:

x11docker ERROR: Image '/home/werner/x11docker' not available locally and not pulled from docker hub.

mviereck commented 4 years ago

Another problem is the --home option must be assigned with the '= ', i.e., as follows:

Yes, that is correct behaviour. Because the path argument is optional, there must be set a = if you want to set a path. Otherwise --home path would be ambiguous. How to decide if path belongs to --home and is not e.g. an image name?

hongyi-zhao commented 4 years ago

Finally, I understand the reason for doing so. Thanks for your explanation.