-
Notifications
You must be signed in to change notification settings - Fork 43
chore(README.md): add instructions for local iteration without a Git repo #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
41d7372
chore(README.md): add instructions for local iteration without a Git …
johnstcn fb0b47d
add note regarding ENVBUILDER_DEVCONTAINER_DIR
johnstcn dcfe563
fixup! add note regarding ENVBUILDER_DEVCONTAINER_DIR
johnstcn c494224
mention ENVBUILDER_WORKSPACE_FOLDER
johnstcn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ docker run -it --rm \ | |
Edit `.devcontainer/Dockerfile` to add `htop`: | ||
|
||
```bash | ||
$ vim .devcontainer/Dockerfile | ||
vim .devcontainer/Dockerfile | ||
``` | ||
|
||
```diff | ||
|
@@ -53,6 +53,32 @@ Exit the container, and re-run the `docker run` command... after the build compl | |
> If you need to bypass this behavior for any reason, you can bypass this safety check by setting | ||
> `ENVBUILDER_FORCE_SAFE=true`. | ||
|
||
If you don't have a remote Git repo or you want to quickly iterate with some | ||
local files, simply omit `ENVBUILDER_GIT_URL` and instead mount the directory | ||
containing your code to `/workspaces/empty` inside the Envbuilder container. | ||
|
||
For example: | ||
|
||
```shell | ||
# Create a sample Devcontainer and Dockerfile in the current directory | ||
printf '{"build": { "dockerfile": "Dockerfile"}}' > devcontainer.json | ||
printf 'FROM debian:bookworm\nRUN apt-get update && apt-get install -y cowsay' > Dockerfile | ||
|
||
# Run envbuilder with the current directory mounted into `/workspaces/empty`. | ||
# The instructions to add /usr/games to $PATH have been omitted for brevity. | ||
docker run -it --rm -e ENVBUILDER_INIT_SCRIPT='/usr/games/cowsay "happy hacking"' -v $PWD:/workspaces/empty ghcr.io/coder/envbuilder:latest | ||
``` | ||
|
||
If your `devcontainer.json` is not present in the root of the workspace folder, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. root or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. |
||
you may need to specify the relative path to the file with | ||
`ENVBUILDER_DEVCONTAINER_DIR`: | ||
|
||
```shell | ||
ls build/ | ||
Dockerfile devcontainer.json | ||
docker run -it --rm -e ENVBUILDER_INIT_SCRIPT='echo $PATH' -e ENVBUILDER_DEVCONTAINER_DIR=build -v $PWD:/workspaces/empty ghcr.io/coder/envbuilder:latest | ||
``` | ||
|
||
## Usage with Coder | ||
|
||
Coder provides sample | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
empty
a magic name here? Or does any name work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to also mention
ENVBUILDER_WORKSPACE_FOLDER
.