xref: /aosp_15_r20/external/pigweed/docker/docs.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1*61c4878aSAndroid Build Coastguard Worker------
2*61c4878aSAndroid Build Coastguard WorkerDocker
3*61c4878aSAndroid Build Coastguard Worker------
4*61c4878aSAndroid Build Coastguard Worker``pw_env_setup`` reliably initializes a working environment for Pigweed, but
5*61c4878aSAndroid Build Coastguard Workercan take awhile to run. It intelligently caches where it can, but that caching
6*61c4878aSAndroid Build Coastguard Workeris designed around a particular execution environment. That environment
7*61c4878aSAndroid Build Coastguard Workerassumption is poor when running tests with Docker. To help out teams using
8*61c4878aSAndroid Build Coastguard WorkerDocker for automated testing, the Pigweed team has a publicly-available Docker
9*61c4878aSAndroid Build Coastguard Workerimage with a cache of some of the Pigweed environment. The current tag of this
10*61c4878aSAndroid Build Coastguard Workerimage is in ``docker/tag`` under the Pigweed checkout.
11*61c4878aSAndroid Build Coastguard Worker
12*61c4878aSAndroid Build Coastguard WorkerWe're still trying to improve this process, so if you have any ideas for
13*61c4878aSAndroid Build Coastguard Workerimprovements please `create an issue`_.
14*61c4878aSAndroid Build Coastguard Worker
15*61c4878aSAndroid Build Coastguard Worker.. _create an issue: https://issues.pigweed.dev/issues?q=status:open
16*61c4878aSAndroid Build Coastguard Worker
17*61c4878aSAndroid Build Coastguard WorkerBuild your own Docker image
18*61c4878aSAndroid Build Coastguard Worker===========================
19*61c4878aSAndroid Build Coastguard Worker
20*61c4878aSAndroid Build Coastguard WorkerTo build your own Docker image, start with ``docker/Dockerfile.cache`` and
21*61c4878aSAndroid Build Coastguard Workerrun ``docker build --file docker/Dockerfile.cache .`` from the root of your
22*61c4878aSAndroid Build Coastguard WorkerPigweed checkout.
23*61c4878aSAndroid Build Coastguard Worker
24*61c4878aSAndroid Build Coastguard WorkerUse the publicly available Docker image
25*61c4878aSAndroid Build Coastguard Worker=======================================
26*61c4878aSAndroid Build Coastguard Worker
27*61c4878aSAndroid Build Coastguard WorkerTo use the publicly-available Docker image, run
28*61c4878aSAndroid Build Coastguard Worker``docker build --file docker/Dockerfile.run --build-arg from=$(cat docker/tag) .``
29*61c4878aSAndroid Build Coastguard Workerfrom the root of your Pigweed checkout. You still need to run
30*61c4878aSAndroid Build Coastguard Worker``. ./bootstrap.sh`` within the Docker image, but it should complete much
31*61c4878aSAndroid Build Coastguard Workerfaster than on a vanilla Docker image.
32