Launching Google Chrome on Docker container


Launch GUI applications(Google Chrome in this case) on top of Docker container.

Content of this Blog

  • Prerequisite
  • Project Understanding
  • Output


For Docker, refer the following link:

Project Understanding

Docker containers are by default CLI-based in nature and requires a physical display to run GUI applications. The way to do so involves sharing of Docker host’s display with the container.

In order to perform the above operation, two important concepts needs to be understood which are as follows:

  1. X11 or X Server
  2. DISPLAY environment variable

Let’s understand each one of them

X11 or X Server

X11 is a client/server windowing system for bitmap displays. It is implemented on most UNIX-like operating systems and has been ported to many other systems.

X Server is the program or dedicated terminal that displays the windows and handles input devices such as keyboards, mouse and touchscreens.

DISPLAY environment variable

The DISPLAY environment variable is used by all X clients to determine what X server to display on. Since any X client can connect to any X server that allows it, all X clients need to know what needs to be displayed upon startup.

The format of the DISPLAY variable is


  • hostname: Name or IP of the host
  • D: Display number in case of multiple displays (usually 0)
  • S: Screen number in case of multiple screens (usually 0)

The above Dockerfile updates the DNF/YUM repository and copies the repository required for installation of Google Chrome in yum.repos.d directory, then it installs it using yum and then sets an entrypoint for launching Google Chrome.

Docker Host : RHEL 8


  • -e stands for export and is used for exporting the value of environment variable DISPLAY
  • -v stands for bind mount to a volume i.e., attaching a volume

The X server folder i.e., /tmp/.X11-unix present in the host is mounted to the Docker container using -v option. The reason behind the same is to provide an X server to the container for running GUI applications.


Command Used
Command Output



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store