Skip to content

Commit

Permalink
quick-build: add tips for optimizing docker usage and caching
Browse files Browse the repository at this point in the history
This commit introduces an expanded and detailed guide on improving build times for the Oniro project by leveraging Docker container mounts for `prebuilts` and `ccache`. It provides clear instructions on how to setup the Docker container to preserve these essential assets across builds, significantly reducing subsequent build times. 

Signed-off-by: Francesco Pham <[email protected]>
  • Loading branch information
Francesco Pham authored and Stefan-Schmidt committed Mar 12, 2024
1 parent 3a3191b commit f12c389
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions quick-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,19 @@ To read hilog output:
```bash
hdc hilog
```

### Speeding Up Build Times

You can significantly reduce build times for subsequent builds by mounting directories for prebuilts and ccache when initiating the Docker container. This approach ensures that once the prebuilts are downloaded, they don't need to be fetched again, and the compilation cache is maintained across builds.

To apply this optimization, use the following command to start your Docker container:

```bash
docker run -it -v $(pwd):/home/openharmony/workdir -v ~/openharmony_prebuilts:/home/openharmony/openharmony_prebuilts -v ~/.ccache:/root/.ccache swr.cn-south-1.myhuaweicloud.com/openharmony-docker/docker_oh_standard:3.2
```

After starting the container with the above command, navigate to the `workdir` directory before initiating the build process:

```bash
cd workdir
```

0 comments on commit f12c389

Please sign in to comment.