The `docker build` command assumes that `Dockerfile` is in the root source tree. Note that in this design, this `Dockerfile` is this only one in our repo. Add `--build-arg UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt`
The `docker build` command assumes that `Dockerfile` is in the root source tree. Note that in this design, this `Dockerfile` is this only one in our repo.
if you want to use ubuntu mirrors to speed up the build.
Users can specify a Ubuntu mirror server for faster downloading:
This command mounts the source directory on the host into `/paddle` in the container, so the default entry point of `paddle:dev`, `build.sh`, could build the source code with possible local changes. When it writes to `/paddle/build` in the container, it writes to `$PWD/build` on the host indeed.
This command mounts the source directory on the host into `/paddle` in the container, so the default entry point of `paddle:dev`, `build.sh`, could build the source code with possible local changes. When it writes to `/paddle/build` in the container, it writes to `$PWD/build` on the host indeed.
...
@@ -99,26 +103,25 @@ This command mounts the source directory on the host into `/paddle` in the conta
...
@@ -99,26 +103,25 @@ This command mounts the source directory on the host into `/paddle` in the conta
`build.sh` builds the following:
`build.sh` builds the following:
- PaddlePaddle binaries,
- PaddlePaddle binaries,
-`$PWD/build/paddle-<version>.deb` for production installation, and
-`$PWD/dist/<cpu|gpu|cpu-noavx|gpu-noavx>/paddle-<version>.deb` for production installation, and
-`$PWD/build/Dockerfile`, which builds the production Docker image.
-`$PWD/build/Dockerfile`, which builds the production Docker image.
Environment varibles(use `ON` and `OFF` to put the switch on and off):
Users can specify the following Docker build arguments with either "ON" or "OFF" value:
-`WITH_GPU`: build paddle with gpu driver and libraries.
-`WITH_GPU`: ***Required***. Generates NVIDIA CUDA GPU code and relies on CUDA libraries.
-`WITH_AVX`: only lagacy hardwares without avx or sse or other [SIMD](https://en.wikipedia.org/wiki/SIMD) need to put it to "OFF"
-`WITH_AVX`: ***Required***. Set to "OFF" prevents from generating AVX instructions. If you don't know what is AVX, you might want to set "ON".
-`TEST`: test after build
-`TEST`: ***Optional, default ON***. Build unit tests and run them after building.
-`BUILD_AND_INSTALL`: put this to "OFF" if you don't really want to build, used to generate production Dockerfiles.
-`BUILD_AND_INSTALL`: ***Optional, default ON***. Run `make` and `make install`.
-`DELETE_BUILD_CACHE`: put this to "ON" when build paddle for multiple times, third_party will not download and build again.
-`DELETE_BUILD_CACHE`: ***Optional, default ON***. If set to "ON", the building script will delete, download, and re-build third party libraries.
### Build the Production Docker Image
### Build the Production Docker Image
The following command builds the production image:
The following command builds the production image: