Skip to content

docs: branch selection #154

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 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Build development environments from a Dockerfile on Docker, Kubernetes, and Open

The easiest way to get started is to run the `envbuilder` Docker container that clones a repository, builds the image from a Dockerfile, and runs the `$INIT_SCRIPT` in the freshly built container.

> `/tmp/envbuilder` is used to persist data between commands for the purpose of this demo. You can change it to any directory you want.
> `/tmp/envbuilder` directory persists demo data between commands. You can choose a different directory.

```bash
docker run -it --rm \
Expand All @@ -47,6 +47,14 @@ $ vim .devcontainer/Dockerfile

Exit the container, and re-run the `docker run` command... after the build completes, `htop` should exist in the container! 🥳

### Git Branch Selection

Choose a branch using `GIT_URL` with a _ref/heads_ reference. For instance:

```
GIT_URL=https://github.com/coder/envbuilder-starter-devcontainer/#refs/heads/my-feature-branch
```

## Container Registry Authentication

envbuilder uses Kaniko to build containers. You should [follow their instructions](https://github.com/GoogleContainerTools/kaniko#pushing-to-different-registries) to create an authentication configuration.
Expand Down Expand Up @@ -85,7 +93,7 @@ resource "kubernetes_deployment" "example" {
}
spec {
spec {
container {
container {
# Define the volumeMount with the pull credentials
volume_mount {
name = "docker-config-volume"
Expand Down Expand Up @@ -194,8 +202,7 @@ A sample script to pre-fetch a number of images can be viewed [here](./examples/

The `SETUP_SCRIPT` environment variable dynamically configures the user and init command (PID 1) after the container build process.

> **Note**
> `TARGET_USER` is passed to the setup script to specify who will execute `INIT_COMMAND` (e.g., `code`).
> **Note** > `TARGET_USER` is passed to the setup script to specify who will execute `INIT_COMMAND` (e.g., `code`).

Write the following to `$ENVBUILDER_ENV` to shape the container's init process:

Expand Down Expand Up @@ -225,7 +232,6 @@ docker run -it --rm \
- [`SSL_CERT_DIR`](https://go.dev/src/crypto/x509/root_unix.go#L25): Identifies which directory to check for SSL certificate files.
- `SSL_CERT_BASE64`: Specifies a base64-encoded SSL certificate that will be added to the global certificate pool on start.


# Local Development

Building `envbuilder` currently **requires** a Linux system.
Expand All @@ -243,4 +249,4 @@ On MacOS or Windows systems, we recommend either using a VM or the provided `.de
- `build`: builds and tags `envbuilder:latest` for your current architecture.
- `develop`: runs `envbuilder:latest` against a sample Git repository.
- `test`: run tests.
- `test-registry`: stands up a local registry for caching images used in tests.
- `test-registry`: stands up a local registry for caching images used in tests.
Loading