GUI Container on Docker

# Set ubuntu as base image
FROM ubuntu

# Install dependencies
RUN apt-get -y update
RUN apt-get -y install xauth
RUN apt-get -y install firefox

#Expose a port number
EXPOSE 8887

# Run firefox
CMD /usr/bin/firefox
docker run -ti --net=host -e DISPLAY -v /tmp/.X11-unix <IMAGE NAME> bash
# cd /gui
# vim DockerfileFROM centos:7
RUN yum install xeyes -y
CMD ["/usr/bin/xeyes"]
docker build -t xeyes .
docker images
docker container run -it --env="DISPLAY" --net=host xeyes

--

--

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