Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/georglauterbach/dev-container-base

Development Container Base Image for Common Tasks
https://github.com/georglauterbach/dev-container-base

containers dev-container development-container

Last synced: 5 days ago
JSON representation

Development Container Base Image for Common Tasks

Awesome Lists containing this project

README

        

= Custom Development Container Base Image
:toc:

:link-dev_containers: https://containers.dev/
:link-hermes: https://github.com/georglauterbach/hermes

== About

When working with link:{link-dev_containers}[Development Containers], you most likely build on top of existing images to utilize their existing tools and configuration. This project provides an image packed with as many as necessary and as few as possible configurations and applications to make development a breeze. You can use this image directly, or build on top of it, when configuring your Development Container.

== Technical Information

This image

. is based on link:https://hub.docker.com/_/ubuntu[`docker.io/ubuntu`] and built for `amd64` and `arm64`. Consult link:./Dockerfile[`Dockerfile`] for the complete set of installation steps.
. heavily builds on link:{link-hermes}[_hermes_] to install sensible defaults for the console and useful additional programs. Consult the documentation of link:{link-hermes}[_hermes_] if you'd like to further customize the experience. The process is described https://github.com/georglauterbach/hermes?tab=readme-ov-file#optional-additional-setup[here].
. configures common directories (like `${HOME}/.cache`) with the correct permissions.
. sets environment variables such as
.. `DEV_CONTAINER_BASE_VERSION=#` to check that you are inside a container, to check that you are using this image as a base, and to acquire information about the actual version.
.. `DEV_CONTAINER_BASE_HERMES_VERSION=` to qcquire information about the version of link:{link-hermes}[_hermes_] that is used.
. sets up `doas` so that you can simply run `sudo` inside the container without the need to enter a password.
. sets up a system locale, defaulting to `en_US.UTF-8`.
. does not set nor require a custom `ENTRYPOINT`.

== Optional Additional Setup

=== Proper Caching

To properly persist data that should be cached, you need to provide volumes in `devcontainer.json` for the following directories:

[source,jsonc]
----
{
// Persist the VS Code extension cache; do not mount to `/home/ubuntu/.vscode-server`,
// otherwise, all settings are cached and hence, not be updated anymore.
"source": "-cache-vscode_extensions",
"target": "/home/ubuntu/.vscode-server/extensions",
"type": "volume"
},
{
// Persist the `${HOME}/.cache` directory so that common
// caches are not lost on container restart.
"source": "-cache-home_cache",
"target": "/home/ubuntu/.cache",
"type": "volume"
}
----

=== Locale Setup

When building on top of this image, you can call `sudo update_locales.sh ` to set a new locale. The default is `en_US.UTF-8`.