#Tic-Tac-Toe Dockerized
TicTacToe is an application I got from the public repository: https://github.com/jlombardo/TicTacToeMaven and placed it inside a Docker container.
It's about the 3 in a row game, and it's an application with a small graphical interface, that's why an X11 server is necessary to run it.
An X11 server allows the application inside the container to display its graphical interface on the desktop of your local machine.
On Linux systems, the X11 server is usually installed by default, it would only be necessary to configure it to accept remote connections. This could be done with the following commands.
To enable remote connections to the X11 server:
xhost +
To disable them:
xhost -
On Windows and macOS systems, you could install an X11 server such as Xming or XQuartz , respectively.
To build the docker image, assuming we are located in the same directory where the Dockerfile is:
docker build -t <image_name>:<tag> .
To run a container and test it:
docker run --rm -it --name <container-name> --network host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix <image_name>:<tag>
In this command, the graphical output of the container is redirected to the local machine and the X11 socket of the local server is connected to the container passing it as a volume.
For details about container creation check out the GitHub repository https://github.com/lacalvom/tic-tac-toe-dockerized.git.
Content type
Image
Digest
sha256:c69f53932…
Size
414.8 MB
Last updated
over 3 years ago
docker pull lacalvom/tic-tac-toe