Skip to content

konstructio/devcontainers

 
 

Repository files navigation

Dev Containers

Pre-build Development Containers

Purpose

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.

Images

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.

Base

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.

Full

ghcr.io/kubefirst/devcontainers/full

An image with the main Kubefirst tooling installed.

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.

Usage

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.

Adding new features

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.

Lifecycle scripts

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.

It's just Docker

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.

Contributing

Open in a container

About

Prebuilt development container images

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 47.2%
  • Makefile 34.5%
  • Shell 18.3%