👨‍💻Launch GUI container on the Docker

Yash Panchwatkar
2 min readJun 1, 2021

👉Task 2

👉GUI container on the Docker
🎯Launch a container on docker in GUI mode
🎯Run any GUI software on the container

Today we are going to discuss Task 2 “How to create GUI container on the docker?”

Here I am creating Dockerfile to create an image to get a pre-configured setup of the Jupyter notebook.

Let’s first check docker status.

In this Docker I am using centos: latest image, now the RUN command will first install firefox python3 and internally pip3 will install jupyter in the image.

For the Jupyter notebook, we have to define some environmental variables e.g NOTEBOOK_DIR (working directory) LISTEN_IP(IP on which server will run) PORT(default for Jupyter 8888) BROWSER(browser on which Jupyter notebook will run)

Here EXPOSE 8888 will define which port no will have to expose.

Now let’s create container from image.

Here in the above command -p option is optional. -p is to define port forwarding. So as soon as you hit enter jupyter notebook will launch inside firefox.

So In this way, we can launch jupyter notebook inside the docker container.

Thanks for reading… If any questions please feel free to leave a comment below and Do connect with me on these platforms.

  1. Mail: yashpanchwatkar@gmail.com
  2. LinkedIn: https://www.linkedin.com/in/yash-panchwatkar/

Stay tuned for such awesome stories!

--

--