Skip to content

Commit

Permalink
Merge pull request #256 from gtjamesa/patch-1
Browse files Browse the repository at this point in the history
docs: change docker to bind mount
  • Loading branch information
matteovivona authored Dec 4, 2023
2 parents 5d84edf + 32641cc commit 8ee8b06
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/custom-remote-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,17 @@ __Note: The token value must be the same used for your server's `TURBO_TOKEN` en


## Enable remote caching in Docker
To enable remote caching in Docker, you must pass TURBO_TOKEN inside Dockerfile and temporarily add the `.git` folder to enable the turbo caching. After the build, you should remove the `.git` folder.
To enable remote caching in Docker, you must pass `TURBO_TOKEN` inside Dockerfile and [mount](https://docs.docker.com/build/guide/mounts/#add-bind-mounts) the `.git` folder to enable the turbo caching. The `.git` mount is accessible during the build stage only, and will not be present in the final image.
For example:

```
ENV TURBO_TOKEN=
COPY turbo.json ./
COPY .turbo/config.json ./.turbo/
COPY .git/ ./.git/
RUN pnpm turbo build
RUN rm -rf .git
RUN --mount=type=bind,source=.git,target=.git \
pnpm turbo build
```

## Local environment variables
Expand Down

0 comments on commit 8ee8b06

Please sign in to comment.