浏览代码

Merge pull request #438 from Unity-Technologies/fix/dockerdocs

[docs] Adding information on saving and quitting docker container
/develop-generalizationTraining-TrainerController
GitHub 6 年前
当前提交
3a447437
共有 1 个文件被更改,包括 23 次插入8 次删除
  1. 31
      docs/Using-Docker.md

31
docs/Using-Docker.md


Run the Docker container by calling the following command at the top-level of the repository:
```
docker run --mount type=bind,source="$(pwd)"/unity-volume,target=/unity-volume \
<image-name>:latest <environment-name> \
--docker-target-name=unity-volume \
--train --run-id=<run-id>
docker run --name <container-name> \
--mount type=bind,source="$(pwd)"/unity-volume,target=/unity-volume \
<image-name>:latest <environment-name> \
--docker-target-name=unity-volume \
--train --run-id=<run-id>
- `<container-name>` is used to identify the container (in case you want to interrupt and terminate it). This is optional and Docker will set a random string if this is not set. _Note that this must be unique for every run of a Docker Image_
- `<image-name>` and `<environment-name>`: References the image and environment names, respectively.
- `source`: Reference to the path in your host OS where you will store the Unity executable.
- `target`: Tells Docker to mount the `source` path as a disk with this name.

For the `3DBall` environment, for example this would be:
```
docker run --mount type=bind,source="$(pwd)"/unity-volume,target=/unity-volume \
balance.ball.v0.1:latest 3Dball \
--docker-target-name=unity-volume \
--train --run-id=3dball_first_trial
docker run --name 3DBallContainer.first.trial \
--mount type=bind,source="$(pwd)"/unity-volume,target=/unity-volume \
balance.ball.v0.1:latest 3Dball \
--docker-target-name=unity-volume \
--train --run-id=3dball_first_trial
### Stopping Container and Saving State
If you are satisfied with the progress being made by the algorithm in training, you can stop the docker container, while saving state using the following :
```
docker kill --signal=SIGINT <container-name>
```
`<container-name>` is the name of the container that you set during the `docker run`. If you didn't set the container name there, you can find the automatically generated identifier by running `docker container ls`.
正在加载...
取消
保存