What I want to achieve is an OS with GUI inside a docker container, which I can use like a VM and not only via a command line. My host system is a windows 10.
Based on a few other questions here I created a dockerfile with the following content:
FROM ubuntu:latest
RUN apt update
RUN apt install -y x11vnc xvfb firefox
RUN mkdir ~/.vnc
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
CMD /usr/bin/firefox
I create the build and then set the env variable "DISPLAY" to ":0.0". On my host I also installed VcXsrv. On the container I installed "xfce4" and "slim" as manually (since I can't figure out how to inject multiple different answers to the installation prompt).
When starting the container, a Firefox window opens up but when I close it, the container stops.
My questions:
- How do I start the container in a way so I see the desktop
- How do I close the view on the host without stopping the container
- How do I open the view of the container on the host while the container is running?
- Can anyone help me out with putting the installation of the GUI inside the dockerfile? I read a few things about "expect" but could not really get it working