How to install Fluxbox on Centos in Docker

Repositories which are referenced in the base image of Centos does not contain any package with lightweight X window manager like Fluxbox. If you try to install it, you’ll end up with the following error:

Warning: No matches found for: fluxbox
No matches found

It’s sufficient to add EPEL (Extra Packages for Enterprise Linux) repository:

yum --enablerepo=extras install epel-release

Let’s test this whole setup on Docker image. We will install also TigerVNC server to view the Fluxbox UI:

docker run -p 5901:5901 -it centos /bin/bash
yum -y --enablerepo=extras install epel-release
yum install -y fluxbox tigervnc-server xterm
mkdir -p ~/.vnc
echo "fluxbox &"> ~/.vnc/xstartup
chmod u+x ~/.vnc/xstartup
vncserver

Now connect by your VNC client (e.g. RealVNC) to localhost:5901. The result should look like this: