phyver / GameShell

a game to learn (or teach) how to use standard commands in a Unix shell
GNU General Public License v3.0
2.17k stars 138 forks source link

create a Dockerfile #20

Closed oupala closed 3 years ago

oupala commented 3 years ago

Create a Dockerfile so that anyone can create its own Docker image in order to play gash without to install all the packages needed for that (especially x11-apps and gcc that requires a lot of space).

oupala commented 3 years ago

The docker image can be built using the following command:

docker build -t gash .

and then can be run using the following command:

xhost +"local:docker@" \
&& docker run -it \
     -e DISPLAY=${DISPLAY} \
     -v /tmp/.X11-unix:/tmp/.X11-unix \
     gash 
phyver commented 3 years ago

From my point of view, using a container to avoid installing gcc is a little strange. The docker image will end up being bigger than just installing gcc! (And while I always have gcc installed, I don't always have docker.io.)

I'm sure some people will be interested so I'll merge that in a few days.

Thanks!

oupala commented 3 years ago

I think I understand your point of view.

But on my debian, I don't have gcc, and I have docker.io.

Different people, different habits...

I was also thinking about a teacher that want to let his all class to train with gash. With a docker image, you just have to create a docker container per student and everything is ready!

phyver commented 3 years ago

Merged... I also added a way to deal with dependencies: if they are not satisfied, the mission will just be cancelled. Also, the mission that required gcc can now use clang, or a python3 script.