Skip to content

Commit a4efc74

Browse files
authored
Rename repository and adjust template names (#6)
As part of adding this repository to the official list of community devcontainer template repositories, I want to make it more clear that the initial set of templates that are part of this repository are _barebones_ to avoid confusion with other templates (in particular the official ones). My goals have also evolved beyond just having barebones containers to include some more opinionated ones in the future (e.g. a template for how I set up new Rails projects), so "lightweight" in the repo name doesn't really make sense anymore. - Update existing templates to be called "barebones-X" - Adjust tests and workflows as appropriate - Update repository name as appropriate - Update README with more suitable descriptions
1 parent 2540184 commit a4efc74

File tree

15 files changed

+70
-55
lines changed

15 files changed

+70
-55
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "lightweight-devcontainer-templates",
2+
"name": "csutter-devcontainer-templates",
33
"build": {
44
"dockerfile": "Dockerfile"
55
},

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: test/lint.sh
2727

2828
# TODO: This'll do for now, but generalise these soon
29-
- name: Run Node.js template test
30-
run: test/nodejs/test.sh
31-
- name: Run Ruby template test
32-
run: test/ruby/test.sh
29+
- name: Run barebones-nodejs template test
30+
run: test/barebones-nodejs/test.sh
31+
- name: Run barebones-ruby template test
32+
run: test/barebones-ruby/test.sh

README.md

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# lightweight-devcontainer-templates
1+
# devcontainer-templates
22

3-
My personal, lightweight alternatives to the [default devcontainer templates][vsc_defaults].
3+
A set of devcontainer templates following the nascent [devcontainer template spec][spec_proposal].
44

5-
## Motivation
5+
This repository contains both "barebones" templates aiming to be more lightweight and "batteries
6+
excluded" than the [default templates][vsc_defaults], and some more complex "opinionated" templates
7+
that reflect my personal perspective on a good starting point for new projects in ecosystems/stacks
8+
I frequently use.
69

10+
## Motivation
711
[Development containers][devcontainers] ("devcontainers") are a core part of my development
812
workflow. Microsoft curates an ecosystem of images, templates, and plug-in features that allow users
913
to get started quickly and provide deep integration into VS Code.
@@ -17,47 +21,58 @@ default templates, and the preconfigured images that the templates use:
1721
* The images add a level of abstraction and dependencies that makes them harder to reason about than
1822
a manually maintained `Dockerfile`
1923
* The images are overoptimised for integration with Microsoft tooling
20-
* The generated configuration contains lots of scaffolding that is often left in by developers but
21-
gets outdated as the spec evolves
24+
* The generated configuration contains lots of superfluous scaffolding that is often left in by
25+
developers or left commented but gets outdated as the spec evolves
26+
* The generated configuration for some stacks/ecosystems could be more useful in terms of including
27+
best practices to take full advantage of devcontainers
2228

23-
Some of these issues can be worked around by overriding the default configuration, but still add
24-
cruft. I was looking for a more "bring your own batteries" approach.
29+
I was looking for a more barebones, explicit, and customisable approach on the one hand, and some
30+
more specific and opinionated templates on the other. A set of templates that I could use to set up
31+
a new project in minimal time, without having to refer back to previous projects for inspiration,
32+
and that I could evolve as time goes on.
2533

26-
That said, I'm sure the default templates and images are a great help to less experienced developers
27-
who just want to get started quickly, and those who aren't as familiar with the Docker ecosystem,
28-
so they do have their place.
34+
Consider these templates to complement the default "official" ones - especially for inexperienced
35+
developers and those who don't want to have to customise their environment, the official templates
36+
are probably a better choice.
2937

3038
## Goals
39+
Ultimately, the primary goal of these templates is to meet my need for professional-grade templates
40+
to use when I set up a new project, without having to refer back to previous projects for
41+
inspiration, and that I could evolve as time goes on and the spec and my needs change.
3142

32-
Ultimately, the primary goal of these templates is to meet my need of simple templates to use when
33-
I start a new project - both production-grade projects and throwaway experiments - and avoid the
34-
need to have to copy and adapt configuration from a previous project.
35-
36-
The templates should have:
37-
* Trivial configuration that is easy to understand, extend, customise, and maintain
38-
* Default upstream Docker images for the target language/ecosystem
39-
* No tooling and customisation by default, beyond scaffolding required to:
40-
* run a basic application in the target language/ecosystem, and
41-
* be able to install additional development tools on a non-root user level (as the upstream
42-
images are geared towards production deployments)
43+
The templates should:
44+
- set a "gold standard" for how I would set up a new (or existing) project for a given stack to use
45+
devcontainers
46+
- have simple configuration that is easy to understand, extend, customise, and maintain
47+
- use default upstream Docker images for the target language/ecosystem
48+
- keep the footprint of tooling and customisation small (or to the bare minimum in case of
49+
"barebones" templates)
50+
- use a non-root user, but allow for `sudo` (many upstream images are geared towards production
51+
deployments and run as `root`)
4352

4453
## Suggested usage
45-
4654
Use the templates to generate a basic devcontainer setup, then customise as follows:
4755

4856
* Add OS-level setup and system-level dependencies (e.g. OS package manager packages) to the
4957
`Dockerfile`
5058
* Run add project-specific setup and development ecosystem dependency installation using a
5159
`postCreateCommand` in `devcontainer.json`. If it consists of more than one or two commands,
52-
consider adding a shell script in the `.devcontainer` folder and running that
60+
consider adding a shell script in the `.devcontainer` folder and running that (the opinionated
61+
templates may already have one)
5362
* Add the minimum necessary set of VS Code extensions and configuration to `devcontainer.json`
5463
(leaving space for other contributors/team members to not be overloaded with default setup)
5564
* Any personal preferences of individual developers (e.g. environment customisation or tool
5665
installation) should be dealt with using VS Code's ability to auto-inject user dotfiles and run
5766
an installation script in the process (see the Debian section in [my personal dotfiles][punkt]
5867
install script for an example of how to achieve this).
5968

69+
## Contributions
70+
I've not yet figured out if I want to accept contributions to this repository. If you have an idea
71+
for a bug fix, improvement, or new template that would fit within the scope and philosophy of this
72+
project, please open an issue before you put in substantial work!
73+
6074
[devcontainers]: https://containers.dev
6175
[punkt]: https://github.com/csutter/punkt/blob/main/install.sh
6276
[ruby_issue]: https://github.com/microsoft/vscode-dev-containers/issues/704
77+
[spec_proposal]: https://github.com/devcontainers/spec/blob/main/proposals/devcontainer-templates.md
6378
[vsc_defaults]: https://github.com/devcontainers/templates

src/nodejs/devcontainer-template.json renamed to src/barebones-nodejs/devcontainer-template.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"id": "nodejs",
2+
"id": "barebones-nodejs",
33
"version": "0.1.0",
44
"name": "Node.js",
5-
"description": "A lightweight devcontainer for Node.js/Javascript applications",
5+
"description": "A barebones devcontainer for Node.js/Javascript applications",
66
"publisher": "Christian Sutter",
7-
"documentationURL": "https://github.com/csutter/lightweight-devcontainer-templates",
8-
"licenseURL": "https://github.com/csutter/lightweight-devcontainer-templates/blob/main/LICENSE",
7+
"documentationURL": "https://github.com/csutter/devcontainer-templates",
8+
"licenseURL": "https://github.com/csutter/devcontainer-templates/blob/main/LICENSE",
99
"options": {
1010
"imageVariant": {
1111
"type": "string",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"id": "barebones-ruby",
3+
"version": "0.1.0",
4+
"name": "Barebones Ruby",
5+
"description": "A barebones devcontainer for Ruby applications",
6+
"publisher": "Christian Sutter",
7+
"documentationURL": "https://github.com/csutter/devcontainer-templates",
8+
"licenseURL": "https://github.com/csutter/devcontainer-templates/blob/main/LICENSE",
9+
"options": {
10+
"imageVariant": {
11+
"type": "string",
12+
"description": "Upstream 'ruby' image tag (see hub.docker.com):",
13+
"proposals": [
14+
"3"
15+
],
16+
"default": "3"
17+
}
18+
},
19+
"platforms": ["Ruby"]
20+
}

src/ruby/devcontainer-template.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)