{"id":18581896,"url":"https://github.com/coder/envbuilder","last_synced_at":"2025-05-16T01:07:55.004Z","repository":{"id":162230136,"uuid":"620006704","full_name":"coder/envbuilder","owner":"coder","description":"Build development environments from a Dockerfile on Docker, Kubernetes, and OpenShift. Enable developers to modify their development environment quickly.","archived":false,"fork":false,"pushed_at":"2025-03-27T23:42:20.000Z","size":2565,"stargazers_count":223,"open_issues_count":65,"forks_count":43,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-15T19:08:17.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-27T21:02:59.000Z","updated_at":"2025-05-14T01:29:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"f165c053-a36b-4d5d-bb6e-05dd6f5f4252","html_url":"https://github.com/coder/envbuilder","commit_stats":{"total_commits":264,"total_committers":22,"mean_commits":12.0,"dds":0.7310606060606061,"last_synced_commit":"b1dc2722a44949d951727e4a7adab5477e7842f6"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fenvbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fenvbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fenvbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder%2Fenvbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coder","download_url":"https://codeload.github.com/coder/envbuilder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448578,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T00:08:11.080Z","updated_at":"2025-05-16T01:07:49.991Z","avatar_url":"https://github.com/coder.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\n  \u003ca aria-label=\"Join the community on Discord\" href=\"https://discord.gg/coder\"\u003e\u003cimg src=\"https://img.shields.io/discord/747933592273027093?label=discord\"\u003e\u003c/a\u003e\n  \u003ca aria-label=\"Releases\" href=\"https://github.com/coder/envbuilder/pkgs/container/envbuilder\"\u003e\u003cimg alt=\"\" src=\"https://img.shields.io/github/v/tag/coder/envbuilder\"\u003e\u003c/a\u003e\n  \u003ca aria-label=\"GoDoc\" href=\"https://pkg.go.dev/github.com/coder/envbuilder\"\u003e\u003cimg alt=\"\" src=\"https://pkg.go.dev/badge/github.com/coder/envbuilder.svg\"\u003e\u003c/a\u003e\n  \u003ca aria-label=\"License\" href=\"./LICENSE\"\u003e\u003cimg alt=\"\" src=\"https://img.shields.io/github/license/coder/envbuilder\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Envbuilder\n\n![envbuilder](https://github.com/user-attachments/assets/0a49f5cd-2040-4a07-84ba-8b765b954e57)\n\n_(Video created using [asciinema](https://github.com/asciinema/asciinema) and [agg](https://github.com/asciinema/agg))_\n\nBuild development environments from a Dockerfile on Docker, Kubernetes, and OpenShift. Allow developers to modify their environment in a tight feedback loop.\n\n- Supports [`devcontainer.json`](https://containers.dev/) and `Dockerfile`\n- Cache image layers with registries for speedy builds\n- Runs on Kubernetes, Docker, and OpenShift\n\n## Getting Started\n\nThe easiest way to get started is by running the `envbuilder` Docker container that clones a repository specified by `ENVBUILDER_GIT_URL`, builds the image from a Dockerfile or `devcontainer.json`, and runs the `$ENVBUILDER_INIT_SCRIPT` in the freshly built container.\n\n\u003e **Tips**:\n\u003e - The `/tmp/envbuilder` directory persists demo data between commands. You can choose a different directory if needed.\n\u003e - To clone a different branch, you append it to `ENVBUILDER_GIT_URL` in the form `#refs/heads/my-branch`. For example: `https://github.com/coder/envbuilder-starter-devcontainer#refs/heads/boring-prompt`.\n```bash\ndocker run -it --rm\n    -v /tmp/envbuilder:/workspaces\n    -e ENVBUILDER_GIT_URL=https://github.com/coder/envbuilder-starter-devcontainer\n    -e ENVBUILDER_INIT_SCRIPT=bash\n    ghcr.io/coder/envbuilder\n```\n\nEdit `.devcontainer/Dockerfile` to add `htop`:\n\n```bash\nvim .devcontainer/Dockerfile\n```\n\n```diff\n- RUN apt-get install vim sudo -y\n+ RUN apt-get install vim sudo htop -y\n```\n\nExit the container and re-run the `docker run` command. After the build completes, `htop` should be available in the container! 🥳\n\nTo explore more examples, tips, and advanced usage, check out the following guides:\n\n- [Using Local Files](./docs/using-local-files.md)\n- [Usage with Coder](./docs/usage-with-coder.md)\n- [Container Registry Authentication](./docs/container-registry-auth.md)\n- [Git Authentication](./docs/git-auth.md)\n- [Caching](./docs/caching.md)\n- [Custom Certificates \u0026 Proxies](./docs/proxy.md)\n- [Users](./docs/users.md)\n\n## Setup Script\n\nThe `ENVBUILDER_SETUP_SCRIPT` environment variable dynamically configures the user and init command (PID 1) after the container build process.\n\n\u003e **Note**: `TARGET_USER` is passed to the setup script to specify who will execute `ENVBUILDER_INIT_COMMAND` (e.g., `code`).\n\nWrite the following to `$ENVBUILDER_ENV` to shape the container's init process:\n\n- `TARGET_USER`: Identifies the `ENVBUILDER_INIT_COMMAND` executor (e.g., `root`).\n- `ENVBUILDER_INIT_COMMAND`: Defines the command executed by `TARGET_USER` (e.g. `/bin/bash`).\n- `ENVBUILDER_INIT_ARGS`: Arguments provided to `ENVBUILDER_INIT_COMMAND` (e.g., `-c 'sleep infinity'`).\n\n```bash\n# init.sh - Change the init if systemd exists\nif command -v systemd \u003e/dev/null; then\n  echo \"Hey 👋 $TARGET_USER\"\n  echo ENVBUILDER_INIT_COMMAND=systemd \u003e\u003e $ENVBUILDER_ENV\nelse\n  echo ENVBUILDER_INIT_COMMAND=bash \u003e\u003e $ENVBUILDER_ENV\nfi\n\n# Run envbuilder with the setup script\ndocker run -it --rm\n  -v ./:/some-dir\n  -e ENVBUILDER_SETUP_SCRIPT=/some-dir/init.sh\n  ...\n```\n\n## Environment Variables\n\nYou can see all the supported environment variables in [this document](./docs/env-variables.md).\n\n### Development Containers\n\n[This document](./docs/devcontainer-spec-support.md) keeps track of what parts of the Dev Container specification Envbuilder currently supports.\n\nFeel free to [create a new issue](https://github.com/coder/envbuilder/issues/new) if you'd like Envbuilder to support a particular feature.\n\n### Devfile\n\n\u003e [Devfiles](https://devfile.io/) automate and simplify development by adopting existing devfiles available in the [public community registry](https://registry.devfile.io/viewer).\n\nIssue: [#113](https://github.com/coder/envbuilder/issues/113)\n\n## Contributing\n\nBuilding `envbuilder` currently **requires** a Linux system.\n\nOn macOS or Windows systems, we recommend using a VM or the provided `.devcontainer` for development.\n\n**Additional Requirements:**\n\n- `go 1.22`\n- `make`\n- Docker daemon (for running tests)\n\n**Makefile targets:**\n\n- `build`: Builds and tags `envbuilder:latest` for your current architecture.\n- `develop`: Runs `envbuilder:latest` against a sample Git repository.\n- `test`: Runs tests.\n- `test-registry`: Stands up a local registry for caching images used in tests.\n- `docs/env-variables.md`: Updated the [environment variables documentation](./docs/env-variables.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder%2Fenvbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder%2Fenvbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder%2Fenvbuilder/lists"}