mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

Feature request: Run in container instead of creating a new one from image #288

Closed gcoimbra closed 3 years ago

gcoimbra commented 4 years ago

Hello. So I have this enormous container with about 30 GB size. I don't want to instantiate a new one just to run x11docker. Anyway to run x11docker with it?

mviereck commented 4 years ago

x11docker is not designed to start already existing containers. There is a docker issue re-using X unix sockets.

However, you can create a new image from an existing container with docker commit: https://docs.docker.com/engine/reference/commandline/commit/ You can run x11docker with this new image.

I do not recommend this way but rather to set up a Dockerfile containing everything needed. But it is possible to do so, though.

mviereck commented 4 years ago

Another idea: Run:

x11docker --xoverip --no-auth --xonly --showenv

This just runs an X server only. Security risk: cookie authentication is disabled. In worst case others in the network may access it over TCP, too. This prints variable DISPLAY, e.g. DISPLAY=172.17.0.1:102. In your container run your desired application with e.g. DISPLAY=172.17.0.1:102 xterm.