Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 1 | ------ |
| 2 | docker |
| 3 | ------ |
Rob Mohr | 4ba68e2 | 2020-08-04 15:19:49 -0700 | [diff] [blame] | 4 | ``pw_env_setup`` reliably initializes a working environment for Pigweed, but |
| 5 | can take awhile to run. It intelligently caches where it can, but that caching |
| 6 | is designed around a particular execution environment. That environment |
| 7 | assumption is poor when running tests with docker. To help out teams using |
| 8 | docker for automated testing, the Pigweed team has a publicly-available docker |
| 9 | image with a cache of some of the Pigweed environment. The current tag of this |
| 10 | image is in ``docker/tag`` under the Pigweed checkout. |
Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 11 | |
Rob Mohr | 4ba68e2 | 2020-08-04 15:19:49 -0700 | [diff] [blame] | 12 | To build your own docker image, start with ``docker/Dockerfile.cache`` and |
| 13 | run ``docker build --file docker/Dockerfile.cache .`` from the root of your |
| 14 | Pigweed checkout. |
Rob Mohr | e916d32 | 2020-07-17 09:07:32 -0700 | [diff] [blame] | 15 | |
Rob Mohr | 4ba68e2 | 2020-08-04 15:19:49 -0700 | [diff] [blame] | 16 | To use the publicly-available docker image, run |
| 17 | ``docker build --file docker/Dockerfile.run --build-arg from=$(cat docker/tag) .`` |
| 18 | from the root of your Pigweed checkout. You still need to run |
| 19 | ``. ./bootstrap.sh`` within the docker image, but it should complete much |
| 20 | faster than on a vanilla docker image. |
| 21 | |
| 22 | We're still trying to improve this process, so if you have any ideas for |
| 23 | improvements please `send us a note`_. |
| 24 | |
| 25 | .. _send us a note: pigweed@googlegroups.com |