Skip to content

postfinance/devcontainer-features

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devcontainer-features

This repository provides features that can be used in dev containers.

The features provided here have the following benefits:

  • AMD64 and ARM compatible (when possible)
  • Support for Debian, Ubuntu, Alpine (where possible)
  • Corporate ready (download URLs can be overwritten with e.g. an Artifactory cache but default to the official source)
  • Small and fast
  • Good extensibility

Features

Below is a list with included features, click on the link for more details.

Name Description
browsers Installs various browsers and their dependencies.
build-essential Installs build essentials like gcc.
cypress-deps Installs all dependencies required to run Cypress.
docker-out Installs a Docker client which re-uses the host Docker socket.
eclipse-deps Installs all dependencies required to run the Eclipse IDE.
git-lfs Installs Git LFS.
gitlab-cli Installs the GitLab CLI.
go Installs Go.
goreleaser Installs GoReleaser.
instant-client Installs the Oracle Instant Client Basic package.
jfrog-cli Installs the JFrog CLI.
locale Allows setting the locale.
make Installs Make.
mingw Installs MinGW.
nginx Installs Nginx.
node Installs Node.js.
playwright-deps Installs all dependencies required to run Playwright.
python Installs Python.
sonar-scanner-cli Installs the SonarScanner CLI.
system-packages Install arbitrary system packages using the system package manager.
timezone Allows setting the timezone.
vault-cli Installs the Vault CLI.
zig Installs Zig.

Usage

Versions

Most features allow you to define one or more versions of the software that should be installed by the feature.

The logic in the feature to decide which version to install is as follows:

  • The passed version number is a full version (e.g. 1.24.3) -> Directly install it and fail if it does not work
  • The passed version number is a partial version (e.g. 1.24) -> Lookup the versions and find the highest one which still matches the given one
  • The passed version number is latest -> Lookup the versions and find the highest one.

The preferred way to do this is always by defining the full version number.

NOTE: The URLs for resolving the versions are usually in separate configuration options. This is so that a feature can be configured to use a cache service (e.g. Artifactory) for downloading the binaries but use the live URL for checking versions.

Global overrides

Each feature that needs to download something provides options to override the download URL. This is good if a few projects need a few features. But if many projects need many features, it can become a nightmare to maintain that.

For this reason, there is a possibility to globally set those overrides (e.g. for the whole company):

An environment variable DEV_FEATURE_OVERRIDE_LOCATION can be set to a location where a text file with the overrides can be found.

  • The variable itself can be defined in the devcontainer.json file or already be set in your base images used for dev containers.
  • This file can either be on a reachable web or file path. So it can be hosted in a git repository or directly copied into your base images used for dev containers.

The content of the file is simple key=value like an env file. The key names are DEV_FEATURE_OVERRIDE_<key-to-override>, but you can also just skip the DEV_FEATURE_OVERRIDE_ and directly use the desired key name. So for example:

GO_DOWNLOAD_URL=https://mycompany.com/artifactory/dl-google-generic-remote/go

As the remote can be configured differently (e.g. by including or excluding sub-paths), you might need to check and see which part of the path is expected to be included. Usually as much as possible.

See override-all.env for a file with all possible override variables.

The precedence for the overrides is:

  1. Value set via feature parameter
  2. Value set via environment variable
  3. Values from DEV_FEATURE_OVERRIDE_LOCATION

Special overrides

There are a few sources which are used in multiple installations. For those sources, there is an override that globaly overrides all installations from this sources. Here is the list of those sources and their keys.

DEV_FEATURE_OVERRIDE_GITHUB_DOWNLOAD_URL=...

Unset an Override via Parameter

If an override is set, setting the corresponding parameter to "" will not unset the override. To achieve this, set the parameter to none.

Example:
This environment variable is set: DOCKER_OUT_CONFIG_PATH=https://example.com/config.json

Then set this in your feature to explicitly unset it:

{
    "ghcr.io/postfinance/devcontainer-features/docker-out:0.3.0": {
        "version": "28.3.3",
        "configPath": "none"
    }
}

Extend an existing feature

TBD

About

Contains Features that can be used in Dev-Containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •