{"id":18647258,"url":"https://github.com/ttitcombe/docker_openai_gym","last_synced_at":"2025-10-19T12:57:47.088Z","repository":{"id":44171228,"uuid":"199436710","full_name":"TTitcombe/docker_openai_gym","owner":"TTitcombe","description":"A Docker image for using openai gym with pytorch","archived":false,"fork":false,"pushed_at":"2019-07-31T08:45:40.000Z","size":122,"stargazers_count":11,"open_issues_count":2,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T18:25:18.866Z","etag":null,"topics":["docker","docker-image","dockerfile","gym","openai","openai-gym","pytorch","pytorch-cpu","reinforcement-learning"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TTitcombe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-29T11:05:35.000Z","updated_at":"2024-11-11T07:27:10.000Z","dependencies_parsed_at":"2022-09-02T10:22:34.906Z","dependency_job_id":null,"html_url":"https://github.com/TTitcombe/docker_openai_gym","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TTitcombe/docker_openai_gym","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Fdocker_openai_gym","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Fdocker_openai_gym/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Fdocker_openai_gym/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Fdocker_openai_gym/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TTitcombe","download_url":"https://codeload.github.com/TTitcombe/docker_openai_gym/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTitcombe%2Fdocker_openai_gym/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276077894,"owners_count":25581305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-image","dockerfile","gym","openai","openai-gym","pytorch","pytorch-cpu","reinforcement-learning"],"created_at":"2024-11-07T06:25:22.729Z","updated_at":"2025-09-20T09:48:16.180Z","avatar_url":"https://github.com/TTitcombe.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/TTitcombe/docker_openai_gym.svg?branch=master)](https://travis-ci.com/TTitcombe/docker_openai_gym)\n# OpenAI gym Docker Image\n\nThis Docker image comes with openai and pytorch-cpu. This allows users to start working on reinforcement learning in a couple of easy steps.\n\nThis image is particularly ideal for Windows users, for whom openai gym is not easily installed.\n\nCurrent features:\n* cpu enabled pytorch\n* classic control gym environments\n* box2d environments\n* Recording of environments\n\nTo be developed:\n* Automated environment recording (no manual command entry)\n* environment rendering\n* Atari environments\n* cpu enabled tensorflow\n\n## How to use\n1. Either\n    - Clone the repo and build the image: `docker build --tag=image_name .`\n    - pull the image: `docker pull ttitcombe/rl_pytorch:latest`\n2. Launch the container: `docker run -it --name=container_name image_name python`. This should enter the python interpreter.\n3. Before entering the python interpreter, a script to attach the graphical display should have been run. \n4. If you want to re-enter the container and record, you can run `/usr/local/bin/startup_script.py` as the `CMD`, \ne.g. `docker exec -it container_name /usr/local/bin/startup_script.py`. This should enter a bash script.  \nAlternatively, you can open a bash script and run it from there. \n5. If you want to re-enter the container, record, AND run something, try\n`/usr/local/bin/startup_script.py \"python /path/to/my/file.py\"` as your `CMD`.\n6. If you don't care about recording, use `/bin/bash` to enter bash or `python` to enter the python interpreter.\n\nTo test that the container works, try recording an environment:\n```python\nimport gym\nimport torch\n\nenv_to_wrap = gym.make(\"LunarLander-v1\")\nenv = gym.wrappers.Monitor(env_to_wrap, \"someDir\")\nframe = env.reset()\nis_done = False\nwhile not is_done:\n  action = env.action_space.sample()\n  _, _, is_done, _ = env.step(action)\nenv.close()\nenv_to_wrap.close()\n``` \nIf this doesn't throw an error, then congratulations, you can record OpenAI gym!\n\nYou can extract the recording once you are outside of the container with the command `docker cp container_name:/path/to/my/file local/path/to/file`.\n\n![LunarLander example](results/lunar_lander.gif)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttitcombe%2Fdocker_openai_gym","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttitcombe%2Fdocker_openai_gym","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttitcombe%2Fdocker_openai_gym/lists"}