Skip to content

Commit 961bab7

Browse files
mafredrijohnstcn
authored andcommitted
feat: implement repo-mode (#290)
(cherry picked from commit 9073748)
1 parent 5e10073 commit 961bab7

File tree

8 files changed

+485
-273
lines changed

8 files changed

+485
-273
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -388,5 +388,6 @@ On MacOS or Windows systems, we recommend either using a VM or the provided `.de
388388
| `--coder-agent-subsystem` | `CODER_AGENT_SUBSYSTEM` | | Coder agent subsystems to report when forwarding logs. The envbuilder subsystem is always included. |
389389
| `--push-image` | `ENVBUILDER_PUSH_IMAGE` | | Push the built image to a remote registry. This option forces a reproducible build. |
390390
| `--get-cached-image` | `ENVBUILDER_GET_CACHED_IMAGE` | | Print the digest of the cached image, if available. Exits with an error if not found. |
391+
| `--remote-repo-build-mode` | `ENVBUILDER_REMOTE_REPO_BUILD_MODE` | `false` | Use the remote repository as the source of truth when building the image. Enabling this option ignores user changes to local files and they will not be reflected in the image. This can be used to improving cache utilization when multiple users are building working on the same repository. |
391392
| `--verbose` | `ENVBUILDER_VERBOSE` | | Enable verbose logging. |
392393
<!--- END docsgen --->

constants/constants.go

+4
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,8 @@ var (
2828
// to skip building when a container is restarting.
2929
// e.g. docker stop -> docker start
3030
MagicFile = filepath.Join(MagicDir, "built")
31+
32+
// MagicFile is the location of the build context when
33+
// using remote build mode.
34+
MagicRemoteRepoDir = filepath.Join(MagicDir, "repo")
3135
)

0 commit comments

Comments
 (0)