@@ -37,7 +37,7 @@ docker run -it --rm \
37
37
Edit ` .devcontainer/Dockerfile ` to add ` htop ` :
38
38
39
39
``` bash
40
- $ vim .devcontainer/Dockerfile
40
+ vim .devcontainer/Dockerfile
41
41
```
42
42
43
43
``` diff
@@ -53,6 +53,39 @@ Exit the container, and re-run the `docker run` command... after the build compl
53
53
> If you need to bypass this behavior for any reason, you can bypass this safety check by setting
54
54
> ` ENVBUILDER_FORCE_SAFE=true ` .
55
55
56
+ If you don't have a remote Git repo or you want to quickly iterate with some
57
+ local files, simply omit ` ENVBUILDER_GIT_URL ` and instead mount the directory
58
+ containing your code to ` /workspaces/empty ` inside the Envbuilder container.
59
+
60
+ For example:
61
+
62
+ ``` shell
63
+ # Create a sample Devcontainer and Dockerfile in the current directory
64
+ printf ' {"build": { "dockerfile": "Dockerfile"}}' > devcontainer.json
65
+ printf ' FROM debian:bookworm\nRUN apt-get update && apt-get install -y cowsay' > Dockerfile
66
+
67
+ # Run envbuilder with the current directory mounted into `/workspaces/empty`.
68
+ # The instructions to add /usr/games to $PATH have been omitted for brevity.
69
+ docker run -it --rm -e ENVBUILDER_INIT_SCRIPT=' bash' -v $PWD :/workspaces/empty ghcr.io/coder/envbuilder:latest
70
+ ```
71
+
72
+ Alternatively, if you prefer to mount your project files elsewhere, tell
73
+ Envbuilder where to find them by specifying ` ENVBUILDER_WORKSPACE_FOLDER ` :
74
+
75
+ ``` shell
76
+ docker run -it --rm -e ENVBUILDER_INIT_SCRIPT=' bash ' -e ENVBUILDER_WORKSPACE_FOLDER=/src -v $PWD :/src ghcr.io/coder/envbuilder:latest
77
+ ```
78
+
79
+ By default, Envbuilder will look for a ` devcontainer.json ` or ` Dockerfile ` in
80
+ both ` ${ENVBUILDER_WORKSPACE_FOLDER} ` and ` ${ENVBUILDER_WORKSPACE_FOLDER}/.devcontainer ` .
81
+ You can control where it looks with ` ENVBUILDER_DEVCONTAINER_DIR ` if needed.
82
+
83
+ ``` shell
84
+ ls build/
85
+ Dockerfile devcontainer.json
86
+ docker run -it --rm -e ENVBUILDER_INIT_SCRIPT=' bash' -e ENVBUILDER_DEVCONTAINER_DIR=build -v $PWD :/src ghcr.io/coder/envbuilder:latest
87
+ ```
88
+
56
89
## Usage with Coder
57
90
58
91
Coder provides sample
0 commit comments