TTitcombe / docker_openai_gym

A Docker image for using openai gym with pytorch
10 stars 9 forks source link

[enhancement] a few suggestions #4

Open MartinaRuocco opened 3 years ago

MartinaRuocco commented 3 years ago

Hi!

I'm sorry if this might be a silly question (I'm new to Docker) but what do you mean by

Before entering the python interpreter, a script to attach the graphical display should have been run.

? Can you provide an example, please?

TTitcombe commented 3 years ago

No that's my fault - it's not worded very well. You don't have to do anything for that line in the documentation.

What that was saying is that it's possible to configure a dockerfile to execute something in a container before the container actually starts. The last line in the Dockerfile does this: ENTRYPOINT ["/usr/local/bin/startup_script.sh"]

This means that when you run the command to run the container and enter the interpreter this script will run (I said "should" because I didn't know Docker very well when I wrote this, so wasn't 100% confident). That script makes the graphical display work.

MartinaRuocco commented 3 years ago

Alright, thanks @TTitcombe!

It's worth mentioning that at the time I am writing this comment, there is a bug in the video_recording.py script of the gym library that I solved by modifying it.
For future reference, whoever wants to modify an image can follow this guide. In summary:

  1. run the container docker run -it test_container old-image-name bash
  2. From the shell, make the changes in the container as required (in this case, I modified the video_recording.py script). Once done, exit the container.
  3. from a new terminal docker commit test_container new-image-name