install_Docker_en.md 3.6 KB
Newer Older
1
# Install on Docker
A
acosta123 已提交
2 3 4 5 6

[Docker](https://docs.docker.com/install/) is an open-source application container engine, with which you can seperate the installation and use of PaddlePaddle from the system environment, and share GPU and network resources with the localhost.

## Environment Preparations

7
- For system types supported currently, please refer to [Installation Instructions](./index_en.html). Using Docker on CentOS 6 is not supported.
A
acosta123 已提交
8 9 10 11 12 13 14 15 16

- [Install Docker](https://hub.docker.com/search/?type=edition&offering=community) on the localhost.

- If you need to start GPU supporting on Linux, please [install nvidia-docker](https://github.com/NVIDIA/nvidia-docker).

## Installation Steps

1. Pull PaddlePaddle image

A
acosta123 已提交
17
	* CPU version PaddlePaddle: `docker pull hub.baidubce.com/paddlepaddle/paddle:[version number]`
A
acosta123 已提交
18

A
acosta123 已提交
19
	* GPU version PaddlePaddle: `docker pull hub.baidubce.com/paddlepaddle/paddle:[version number]-gpu-cuda9.0-cudnn7`
A
acosta123 已提交
20

A
acosta123 已提交
21
    Please fill in the version number of PaddlePaddle such as 1.2 after `:`. For more details, please refer to [Image Instructions](#dockers).
A
acosta123 已提交
22

23
2. Construct and enter a Docker container
A
acosta123 已提交
24 25 26

	`docker run --name [Name of container] -it -v $PWD:/paddle <imagename> /bin/bash`

27
	> The meanings of the parameters in the command above : --name [Name of container]  sets the name of Docker;-it means the container has been working interactively with the localhost; -v $PWD:/paddle  mounts the present path (PWD will be expanded to the absolute path on Linux) to /paddle directory inside the container; `<imagename>`  specifies the name of the image needed, and you can check it by `docker images` command;/bin/bash  is the command to execute in Docker.
A
acosta123 已提交
28

29
So far, you have installed PaddlePaddle with Docker successfully, for more usage details please refer to [Docker Official Documents](https://docs.docker.com)
A
acosta123 已提交
30 31 32

<a name="dockers"></a>
</br></br>
33
### Introduction to Images
A
acosta123 已提交
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
<p align="center">
<table>
	<thead>
	<tr>
		<th> version name </th>
		<th> version instructions </th>
	</tr>
	</thead>
	<tbody>
	<tr>
		<td> hub.baidubce.com/paddlepaddle/paddle:latest </td>
		<td> newest image having installed CPU version PaddlePaddle </td>
	</tr>
		<tr>
		<td> hub.baidubce.com/paddlepaddle/paddle:[Version] </td>
		<td> old version image having installed PaddlePaddleversion </td>
	</tr>
	<tr>
		<td> hub.baidubce.com/paddlepaddle/paddle:latest-gpu </td>
		<td> newest image having installed GPU version PaddlePaddle </td>
	</tr>
		<tr>
		<td> hub.baidubce.com/paddlepaddle/paddle:latest-dev </td>
		<td> newest development environment of PaddlePaddle </td>
	</tr>
   </tbody>
</table>
</p>

You can find docker images of all versions of PaddlePaddle in [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/).

65
### Tips
A
acosta123 已提交
66

67
* Python version is 2.7 in the images
68
* PaddlePaddle Docker doesn't install `vim` by default in order to reduce the volume, and you can install it by executing `apt-get install -y vim` command in the container to edit codes.
A
acosta123 已提交
69 70 71 72 73 74 75 76 77 78 79

### Supplementary Instructions

* When you need to enter Docker container the second time, please use the following commands:
```
	#start the previously constructed container
	docker start [Name of container]

	#enter the started container
	docker attach [Name of container]
```
80
* If you are new with Docker, please refer to information on the Internet, such as [Docker Tutorial](http://www.runoob.com/docker/docker-hello-world.html) .
A
acosta123 已提交
81

82
## How to uninstall
A
acosta123 已提交
83 84 85 86 87 88 89

After entering Docker, execute the following commands:

* ***CPU version PaddlePaddle***: `pip uninstall paddlepaddle`

* ***GPU version PaddlePaddle***: `pip uninstall paddlepaddle-gpu`

90
or use `docker rm [Name of container]` to delete a Docker container directly.
A
acosta123 已提交
91