This repo will provide you a container with the XFCE graphical interface.
It's based on accetto/ubuntu-vnc-xfce, that you can find on him repository at https://github.com/accetto
Inside the container, you can install any graphical app. By the way, you can use the version with Wine to install a Windows application.
It's use XFCE4, a very lightweight graphical interface for linux, and NoVNC, a http server with VNC protocol.
version: '3'
services:
gui:
#build: .
image: hudsonventura/dockerwithgui:latest
#image: hudsonventura/dockerwithgui:latest_withwine
restart: always
ports:
# port for connect via VNC app
- "5901:5901"
#port for conect via noNVC (via http browser like http://localhost:6901)
- "6901:6901"
environment:
# the password must be up to 8 charactrers. This is limited by VNC Protocol
- "VNC_PW=DWGui"
To operate the container
sudo docker compose up
sudo docker compose down
Change docker compose file to get local image:
Uncomment #build: . from docker-compose file.
sudo docker compose --build
apt update
apt install firefox
If you want to persist some information, you must use volumes.
When you destroy the container with command sudo docker compose down, all information inside the container also will be destroyed.
If you want to create a image with some apps installed, edit the Dockerfile or create a new Dockerfile and put the image hudsonventura/dockerwithgui:latest or hudsonventura/dockerwithgui:latest_withwine in FROM.
Full documentation is available at https://github.com/hudsonventura/DockerWithGui.
Credits: https://github.com/accetto