I want to run Chromium browser inside docker container. So the first step for me would be just to manage to start startx inside container. Now I managed to make service which is just: startx
Now when I start Virtual Machine with base ubuntu it opens startx GUI and I can manipulate it (use it's gui, open browser etc.). After that I added .xinitrc with chromium-browser --kiosk inside it to open browser in kiosk mode, added Xwrapper.config inside /etc/X11/ and export DISPLAY=:0 and works perfectly fine. So the wanted behavior is when I boot my VM I want to open chromium browser directly without doing any manipulation on connected screen to VM.
Is the same what I did with systemd service and .xinitrc possible with docker container with base ubuntu image?
For now what I tried is following: Dockerfile looks like this:
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
xfce4-session \
xfce4-goodies \
xinit \
snap \
snapd \
chromium-browser
# Set the default command to startx
CMD ["startx"]
So when I start container with:
docker run --rm --privileged -it --net=host my-chromium-image
Container runs, gui starts and gets stuck and frozen and I cannot do anything.