Pre-build Development Containers
This is a series of pre-built Dev Container images to enable local development. This allows us to ship the development environment as part of our source code, meaning that we can onboard new developers quickly and open-source contributors can get working really quickly.
There are a number of images that exist and each have slightly different purposes. These images are rebuilt weekly to ensure that they have all the latest-and-greatest bugfixes and improvements.
ghcr.io/kubefirst/devcontainers/base
This provides a base image to use for all your development environment need. This is an Ubuntu image with sensible defaults, including the best-looking Git diffs, Docker support, tab-completion and useful Git aliases.
ghcr.io/kubefirst/devcontainers/full
An image with the main Kubefirst tooling installed.
- Go ✅
- Homebrew ✅
- Kubernetes and Helm ✅
- Kubectx ✅
- K9s ✅
- mkcert ✅
- Node.js ✅
- Pre-Commit ✅
- Python ✅
- Terraform ✅
The advantage of using this image is that the features are pre-built which shifts the build effort into GitHub Actions rather than on your local machine.
This can be easily extended with additional features by adding them to your
.devcontainer/devcontainer.json
file.
These images can be used in any way that Dev Containers supports. Typically,
this would be by specifying the image
in your devcontainer.json
file:
{
"name": "devcontainer",
"image": "ghcr.io/kubefirst/devcontainers/full",
"features": {}
}
As this image is pre-built, it will vastly speed up your workflow. The recommended
workflow is to pull the image separately (eg, docker pull ghcr.io/kubefirst/devcontainers/full
),
but it is not a requirement.
Sometimes, this will be used in a project and a feature is required just for
that. You can easily add additional languages or tooling to your Dev Container
by adding to your features
object. For example, if you wanted to add Rust to
your container, all you have to do is add:
{
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
}
}
Additional features can be found on the Dev Container Features page.
You can also use the lifecycle scripts to run arbitrary commands when your container is run:
{
"postAttachCommand": {
"mkcertInstall": "mkcert -install"
}
}
You are advised to use the object notation for the lifecycle scripts so that additional scripts may be added in future.
Ultimately, Dev Containers are just Docker containers run in a way that your IDE
is able to manage. If you wish to connect to the container via your terminal,
simply running docker exec -it -n <container-id>
will get you in there.