A quick reference for using MineDojo in docker container. This may be useful since MineDojo has limited examples and contain some unresolved bugs.
git clone https://github.com/j3soon/docker-minedojo.git
cd docker-minedojo
docker build -t j3soon/minedojo-example .
# stop and remove the container if exists
docker stop minedojo && docker rm minedojo
# launch the container
docker run --name minedojo -it --gpus all -p 8080:8080 -d \
-v $PWD:/workspace \
j3soon/minedojo-example tail -f /dev/null
# exec into the container
docker exec -it minedojo /bin/bash
In the container, run the followings to test the installation:
vglrun python /workspace/MineDojo/scripts/validate_install.py
vglrun python /workspace/MineCLIP/main/mineagent/run_single.py
vglrun python /workspace/MineCLIP/main/mineagent/run_env_in_loop.py
vglrun python /workspace/MineCLIP/main/dense_reward/animal_zoo/run.py
If you're going to use the host MineDojo and MineCLIP, run the following in the container:
pip uninstall -y minedojo mineclip
rm -r ~/MineDojo ~/MineCLIP
pip install -e /workspace/MineCLIP
pip install -e /workspace/MineDojo
or simply rebuild the image.
The following commands should be ran in the container.
vglrun python /workspace/MineCLIP/main/dense_reward/animal_zoo_dig_down/run.py
observe the video where the player is digging downwards.
video-dig-down.mp4
In the animal zoo example, destroying blocks might disrupt training. To prevent this, we can switch the game mode to Adventure, which disables player from destroying the terrain:
/workspace/scripts/set_adventure_mode.sh
and test it with the script:
vglrun python /workspace/MineCLIP/main/dense_reward/animal_zoo_dig_down/run.py
observe the video where the player is digging downwards but cannot due to Adventure mode.
video-dig-down-adventure.mp4
The script above simply apply a quick hack by changing the line <AgentSection mode="Survival">
to <AgentSection mode="Adventure">
in MineDojo/minedojo/sim/mc_meta/minedojo_mission.xml.j2
, which can also be done manually.
You can revert this change by:
/workspace/scripts/set_survival_mode.sh
- MineDojo documentation Installation section
- j3soon/MineDojo (commit 8950d4e) forked from MineDojo/MineDojo (commit 2731bc2)
- MineDojo/egl-docker (commit 932155a)
- MineDojo/MineCLIP (commit e6c06a0)