Skip to content

Commit 50115de

Browse files
Paul Beltsylvestre
Paul Belt
authored andcommitted
doc: Update README with integration instructions
1 parent e8b9af4 commit 50115de

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

README.md

+42-1
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,49 @@ cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
178178
And you can build code as usual without any additional flags in the command line, which is useful for IDEs.
179179

180180

181-
---
181+
----
182+
Pipeline Integration
183+
--------------------
184+
185+
Some CI/CD pipelines leverage repository cloning. Below is a copy-paste-able example to build docker images for such workflows.
186+
As no official image exists (at this time), an image must first be built.
187+
188+
#### Building the most compatible base image
189+
190+
```sh
191+
docker build -f docker/Dockerfile.alpine -t sccache:latest --compress . --target=pipeline
192+
```
193+
194+
#### Building the least bits-on-the-wire base image (Debian)
195+
196+
```sh
197+
docker build -f docker/Dockerfile.bookworm -t sccache:latest --compress . --target=pipeline
198+
```
199+
200+
#### Integration into existing pipelines
201+
202+
If a `Dockerfile` currently uses something like `RUN ./configure && make && make install`, first build the sccache base image:
182203

204+
```sh
205+
docker build -f docker/Dockerfile.alpine -t sccache:latest --compress .
206+
```
207+
208+
Then copy the binary into the existing `Dockerfile`
209+
210+
```dockerfile
211+
COPY --from sccache:latest /bin/sccache /usr/local/bin/
212+
```
213+
214+
... and read the usage instructions here:
215+
https://github.com/mozilla/sccache?tab=readme-ov-file#usage
216+
217+
Cache persistence is specific to CI/CD pipeline architecture. Therefore, it is necessary to configure cache persistence on a per pipeline basis. See https://github.com/mozilla/sccache?tab=readme-ov-file#storage-options for more information. For local storage, that would mean mounting docker volumes.
218+
219+
```sh
220+
docker run -it -v "$(cd;pwd)"/.sccache:/root/.sccache sccache:latest
221+
```
222+
223+
---
183224
Build Requirements
184225
------------------
185226

0 commit comments

Comments
 (0)