This repository contains a Docker image with headless VNC environments for Automation Testing.
Each Docker image is installed with the following components:
- Desktop environment Xfce4 or IceWM
- VNC-Server (default VNC port
5901
) - noVNC - HTML5 VNC client (default http port
6901
) - Browsers:
- Mozilla Firefox
- Chromium
- Python3.8 with pip
- OpenJDK 1.8.0
- Nodejs with protractor and Typescript
It's also possible to run the images in container orchestration platforms like Kubernetes or OpenShift. For more information how to deploy containers in the cluster, take a look at:
Usage is similar for all provided images, e.g. for consol/centos-xfce-vnc
:
-
Build an image from scratch:
docker build -t docker:final .
-
Run command with mapping to local port
5901
(vnc protocol) and6901
(vnc web access):docker run -d -p 5901:5901 -p 6901:6901 docker:final
-
Change the default user and group within a container to your own with adding
--user $(id -u):$(id -g)
:docker run -d -p 5901:5901 -p 6901:6901 --user $(id -u):$(id -g) consol/centos-xfce-vnc
-
Run the container with root access:
docker run -d -p 5901:5901 -p 6901:6901 -u 0 docker:final
-
If you want to mount a local directory to the container use the below command
docker run --name npminstall -v <absolute_local_directory>:<container_directory> -p 5901:5901 -p 6901:6901 -e VNC_RESOLUTION=1920x960 --shm-size=1g -u 0 docker:npminstall
If the container is started like mentioned above, connect via one of these options:
- connect via VNC viewer
localhost:5901
, default password:vncpassword
- connect via noVNC HTML5 full client:
http://localhost:6901/vnc.html
, default password:vncpassword
- connect via noVNC HTML5 lite client:
http://localhost:6901/?password=vncpassword