GUI on the Docker 🐋

Pranita Gughane
3 min readJun 1, 2021

What is Docker?

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.

Task Description 📄

📌 GUI container on the Docker

🔅 Launch a container on docker in GUI mode

🔅 Run any GUI software on the container

Lets start with the task:

  1. Installing docker

A ] Configure yum for Docker :

Create a file “/etc/yum.repos.d/docker.repo”
[docker]
name=docker repo baseurl=https://download.docker.com/linux/centos/7/x86_64/stable/
gpgcheck=0
Docker repo

After this verify by “yum repolist” . You see some more software.

B] Install Docker and start service :

yum install docker-ce — nobest # Install docker 
systemctl start docker # Start Docker service
systemctl enable docker #Enable Docker service
Install Docker

2. Pulling Docker Image

Pull the Docker container image of CentOS image from DockerHub and create a new container

“docker pull centos:latest” is used for pulling image

docker pull centos:latest
Commands to pull and create a docker container

3. Launch a container

docker run -it — name <os_name> — net=host — env=”DISPLAY” — volume=”$HOME/.Xauthority:/root/.Xauthority:rw” <image>:<version>
Check the Docker status

4. Install required packages in container

# python # firefox
yum install python36 firefox -y
Install python36 and Firefox inside the container
# installing required libraries for task
pip3 install jupyter
Install python libraries using pip

5. launch jupyter notebook inside container

jupyter notebook# installing required libraries for task
pip3 install jupyter

jupyter notebook --allow-root
Launch Jupyter Notebook

That’s all for this blog, hope you liked it..🙌🏻😁📃

Thanks for Visiting here…!!!

You can also follow me on my LinkedIn profile by clicking on following link.

--

--