GUI Container on the Docker..!!

  • Applications that run as a Background Service (like a Database, WebServer, etc)
  • GUI Applications that (obviously!) run in the foreground

1. Creating the Dockerfile.

  • A Dockerfile is a text configuration file written using a special syntax
  • It describes step-by-step instructions of all the commands you need to run to assemble a Docker Image.
creating the Dockerfile.
The Code Inside the Docker file.

2. Build the Docker Image

  • The docker build command processes this file generating a Docker Image in your Local Image Cache, which you can then start-up using the #docker run command, or push to a permanent Image Repository.
Command 1 & 2
Successfully build the docker image.

3. Check whether the image is launched.

4.Run the Docker Image.

  • run container with host network driver with
  • --net=host
  • share the Host’s DISPLAY environment variable to the Container
  • --env="DISPLAY"
  • share the Host’s XServer with the Container by creating a volume
  • --volume="$HOME/.Xauthority:/root/.Xauthority:rw"
firefox successfully launched.



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