diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cf2cdbc..24d7369 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,10 +1,10 @@ { "name": "TheDiveO's devcontainer features", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { - "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/devcontainers/features/node:2": {}, "./devcontainers-cli": {}, - "ghcr.io/devcontainers/features/docker-in-docker:2": { + "ghcr.io/devcontainers/features/docker-in-docker:3": { "version": "latest", "moby": false // go for the upstream Docker-CE }, diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b92d671..e8d26db 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,19 +17,19 @@ jobs: - bpftool - cni-plugins - docsify - - grafanactl - - gocover - go-ebpf - go-mod-upgrade + - gocover - goreportcard + - grafanactl - lazygit - local-pkgsite - nerdctl - pin-github-action - pull-through-cache-registry - - wal-wahl + # - wal-wahl baseImage: - - mcr.microsoft.com/devcontainers/base:ubuntu-24.04 + - mcr.microsoft.com/devcontainers/base:ubuntu steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6 @@ -37,4 +37,4 @@ jobs: run: npm install -g @devcontainers/cli@0.84.1 - name: "generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" - run: devcontainer features test --skip-duplicated -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . + run: devcontainer features test --skip-autogenerated --skip-duplicated -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . diff --git a/README.md b/README.md index 2304f7f..c4fa8ca 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ doesn't support Alpine. | --------------------------- | ------ | ---- | ------ | ------ | ------ | | bpftool | ✅ | ✅ | ✅ | ✅ | ✅ | | cni-plugins | | ✅ | ✅ | ✅ | ✅ | -| docsify | | ? | ✅ | ? | ✅ | +| docsify | | ✅ | ✅ | ✅ | ✅ | | go-ebpf | | ✅ | ✅ | ✅ | ✅ | | go-mod-upgrade | | ✅ | ✅ | ✅ | ✅ | | gocover | | ✅ | ✅ | ✅ | ✅ | diff --git a/TESTING.md b/TESTING.md index 68b366d..09491d2 100644 --- a/TESTING.md +++ b/TESTING.md @@ -5,7 +5,7 @@ To test a particular devcontainer feature, say, `lazygit`: ```bash -devcontainer features test -f lazygit -i mcr.microsoft.com/devcontainers/base:ubuntu -p . +devcontainer features test -f lazygit --skip-autogenerated -i mcr.microsoft.com/devcontainers/base:ubuntu -p . ``` - `--skip-scenarios` ... tests only the `test.sh` test case, but no scenario tests. diff --git a/src/bpftool/README.md b/src/bpftool/README.md index 1ce0d90..ace2a99 100644 --- a/src/bpftool/README.md +++ b/src/bpftool/README.md @@ -1,7 +1,7 @@ # bpftool (bpftool) -Installs bpftool from upstream https://github.com/libbpf/bpftool binary releases. +Installs bpftool binary from upstream https://github.com/libbpf/bpftool binary releases. ## Example Usage @@ -15,7 +15,7 @@ Installs bpftool from upstream https://github.com/libbpf/bpftool binary releases | Options Id | Description | Type | Default Value | |-----|-----|-----|-----| -| version | version of bpftool to install from upstream | string | latest | +| version | version of bpftool binary to install from upstream | string | latest | ## OS Support diff --git a/src/bpftool/devcontainer-feature.json b/src/bpftool/devcontainer-feature.json index efac100..1d76853 100644 --- a/src/bpftool/devcontainer-feature.json +++ b/src/bpftool/devcontainer-feature.json @@ -1,13 +1,13 @@ { "name": "bpftool", "id": "bpftool", - "version": "0.0.3", - "description": "Installs bpftool from upstream https://github.com/libbpf/bpftool binary releases.", + "version": "0.0.4", + "description": "Installs bpftool binary from upstream https://github.com/libbpf/bpftool binary releases.", "options": { "version": { "type": "string", "default": "latest", - "description": "version of bpftool to install from upstream" + "description": "version of bpftool binary to install from upstream" } } } \ No newline at end of file diff --git a/src/docsify/devcontainer-feature.json b/src/docsify/devcontainer-feature.json index cd03f69..30b916b 100644 --- a/src/docsify/devcontainer-feature.json +++ b/src/docsify/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "docsify", "id": "docsify", - "version": "0.1.3", + "version": "0.2.0", "description": "Automatically serves ./docs (or another) workspace directory via 'docsify serve' in the background.", "options": { "port": { @@ -24,7 +24,7 @@ } }, "dependsOn": { - "ghcr.io/devcontainers/features/node:1": { + "ghcr.io/devcontainers/features/node:2": { "version": "lts" } }, diff --git a/src/go-ebpf/NOTES.md b/src/go-ebpf/NOTES.md index bf7bde5..11f2b6c 100644 --- a/src/go-ebpf/NOTES.md +++ b/src/go-ebpf/NOTES.md @@ -1,3 +1,20 @@ +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/go-ebpf:1": {} + } +} +``` + ## PID Namespace Depending on what your eBPF is doing inside the devcontainer (or inside a diff --git a/src/go-ebpf/README.md b/src/go-ebpf/README.md index b1d082a..29fb47a 100644 --- a/src/go-ebpf/README.md +++ b/src/go-ebpf/README.md @@ -7,7 +7,7 @@ Installs clang and llvm, and on top Cilium's bpf2go. ```json "features": { - "ghcr.io/thediveo/devcontainer-features/go-ebpf:0": {} + "ghcr.io/thediveo/devcontainer-features/go-ebpf:1": {} } ``` @@ -23,6 +23,23 @@ Installs clang and llvm, and on top Cilium's bpf2go. - `ms-vscode.cpptools-extension-pack` +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/go-ebpf:1": {} + } +} +``` + ## PID Namespace Depending on what your eBPF is doing inside the devcontainer (or inside a diff --git a/src/go-ebpf/devcontainer-feature.json b/src/go-ebpf/devcontainer-feature.json index d023223..2240dc6 100644 --- a/src/go-ebpf/devcontainer-feature.json +++ b/src/go-ebpf/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Go ebpf development", "id": "go-ebpf", - "version": "0.0.1", + "version": "1.0.0", "description": "Installs clang and llvm, and on top Cilium's bpf2go.", "options": { "bfp2go-version": { @@ -10,12 +10,9 @@ "description": "version of bpf2go to install" } }, - "dependsOn": { - "ghcr.io/devcontainers/features/go:1": { - "version": "latest", - "golangciLintVersion": "latest" - } - }, + "installsAfter": [ + "ghcr.io/devcontainers/features/go" + ], "customizations": { "vscode": { "extensions": [ diff --git a/src/go-mod-upgrade/NOTES.md b/src/go-mod-upgrade/NOTES.md index 05904d8..5548096 100644 --- a/src/go-mod-upgrade/NOTES.md +++ b/src/go-mod-upgrade/NOTES.md @@ -1,3 +1,26 @@ +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:1": {} + } +} +``` + +## `go-mod-upgrade` Command + +Please refer to the [upstream repository +`@oligot/go-mod-upgrade`](https://github.com/oligot/go-mod-upgrade) for +documentation. + ## OS Support Tested only with diff --git a/src/go-mod-upgrade/README.md b/src/go-mod-upgrade/README.md index ea76e51..547030b 100644 --- a/src/go-mod-upgrade/README.md +++ b/src/go-mod-upgrade/README.md @@ -7,11 +7,38 @@ upgrade outdated Go dependencies interactively. ```json "features": { - "ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:0": {} + "ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:1": {} } ``` +## Options +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| version | version of go-mod-upgrade to install | string | latest | + +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/go-mod-upgrade:1": {} + } +} +``` + +## `go-mod-upgrade` Command + +Please refer to the [upstream repository +`@oligot/go-mod-upgrade`](https://github.com/oligot/go-mod-upgrade) for +documentation. ## OS Support diff --git a/src/go-mod-upgrade/devcontainer-feature.json b/src/go-mod-upgrade/devcontainer-feature.json index ffd7b66..ace52b5 100644 --- a/src/go-mod-upgrade/devcontainer-feature.json +++ b/src/go-mod-upgrade/devcontainer-feature.json @@ -1,12 +1,22 @@ { "name": "go-mod-upgrade", "id": "go-mod-upgrade", - "version": "0.1.1", + "version": "1.0.0", "description": "upgrade outdated Go dependencies interactively.", - "dependsOn": { - "ghcr.io/devcontainers/features/go:1": { - "version": "latest", - "golangciLintVersion": "latest" + "keywords": [ + "go", + "mod", + "modules", + "dependencies" + ], + "options": { + "version": { + "type": "string", + "default": "latest", + "description": "version of go-mod-upgrade to install" } - } + }, + "installsAfter": [ + "ghcr.io/devcontainers/features/go" + ] } \ No newline at end of file diff --git a/src/go-mod-upgrade/install.sh b/src/go-mod-upgrade/install.sh index ad6831a..840769e 100755 --- a/src/go-mod-upgrade/install.sh +++ b/src/go-mod-upgrade/install.sh @@ -3,9 +3,11 @@ set -e echo "Activating feature 'go-mod-upgrade'..." +VERSION="${VERSION:-"latest"}" + mkdir -p /tmp/gotools export GOCACHE=/tmp/gotools/cache -go install github.com/oligot/go-mod-upgrade@latest +go install "github.com/oligot/go-mod-upgrade@${VERSION}" rm -rf /tmp/gotools diff --git a/src/gocover/NOTES.md b/src/gocover/NOTES.md index 49633e3..2a9add8 100644 --- a/src/gocover/NOTES.md +++ b/src/gocover/NOTES.md @@ -1,3 +1,20 @@ +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/gocover:1": {} + } +} +``` + ## `gocover` Command This feature installs a new `gocover` command into `/usr/local/bin`. @@ -6,14 +23,14 @@ When run without any flags and arguments, `gocover` will run the unit tests using `go test` on all packages in the Go module in the workspace, and update the `README.md` file with a badge showing the coverage percentage. -### CLI Flags +### `gocover` CLI Flags | Flag | Meaning | | --- | --- | | `-r`, `-root`, `--root` | run tests additionally also as root. | -| `-noroot`, `--no-root` | don't run tests also as root, even if feature was configured with root=true. | +| `-noroot`, `--no-root` | don't run tests also as root, even if this feature was configured with `root`:`true`. | | `-html`, `--html` | additionally generate `coverage.html` | -| `-nohtml`, `--no-html` | don't generate `coverage.html, even if feature was configured with html=true. | +| `-nohtml`, `--no-html` | don't generate `coverage.html`, even if this feature was configured with `html`:`true`. | ### Positional Arguments diff --git a/src/gocover/README.md b/src/gocover/README.md index c2e23d2..aff55db 100644 --- a/src/gocover/README.md +++ b/src/gocover/README.md @@ -1,13 +1,13 @@ # Go Coverage with Badge (gocover) -runs Go unit tests with coverages, updating the README.md with a coverage badge. +a gocover command to run Go unit tests with coverages, updating the README.md with a coverage badge. ## Example Usage ```json "features": { - "ghcr.io/thediveo/devcontainer-features/gocover:0": {} + "ghcr.io/thediveo/devcontainer-features/gocover:1": {} } ``` @@ -26,6 +26,23 @@ runs Go unit tests with coverages, updating the README.md with a coverage badge. | green | percentage number for the badge to become green | string | 80 | | yellow | percentage number for the badge to become yellow | string | 50 | +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/gocover:1": {} + } +} +``` + ## `gocover` Command This feature installs a new `gocover` command into `/usr/local/bin`. @@ -34,14 +51,14 @@ When run without any flags and arguments, `gocover` will run the unit tests using `go test` on all packages in the Go module in the workspace, and update the `README.md` file with a badge showing the coverage percentage. -### CLI Flags +### `gocover` CLI Flags | Flag | Meaning | | --- | --- | | `-r`, `-root`, `--root` | run tests additionally also as root. | -| `-noroot`, `--no-root` | don't run tests also as root, even if feature was configured with root=true. | +| `-noroot`, `--no-root` | don't run tests also as root, even if this feature was configured with `root`:`true`. | | `-html`, `--html` | additionally generate `coverage.html` | -| `-nohtml`, `--no-html` | don't generate `coverage.html, even if feature was configured with html=true. | +| `-nohtml`, `--no-html` | don't generate `coverage.html`, even if this feature was configured with `html`:`true`. | ### Positional Arguments diff --git a/src/gocover/devcontainer-feature.json b/src/gocover/devcontainer-feature.json index 2e0e7c7..e346a6c 100644 --- a/src/gocover/devcontainer-feature.json +++ b/src/gocover/devcontainer-feature.json @@ -1,8 +1,13 @@ { "name": "Go Coverage with Badge", "id": "gocover", - "version": "0.1.4", - "description": "runs Go unit tests with coverages, updating the README.md with a coverage badge.", + "version": "1.0.0", + "description": "a gocover command to run Go unit tests with coverages, updating the README.md with a coverage badge.", + "keywords": [ + "go", + "coverage", + "badge" + ], "options": { "root": { "type": "boolean", @@ -42,7 +47,7 @@ "uncovered-packages": { "type": "string", "default": "", - "description": "space separated optional list of package patterns to exclude from coverage analysis" + "description": "space separated optional list of package patterns to exclude from coverage analysis" }, "green": { "type": "string", @@ -55,10 +60,7 @@ "description": "percentage number for the badge to become yellow" } }, - "dependsOn": { - "ghcr.io/devcontainers/features/go:1": { - "version": "latest", - "golangciLintVersion": "latest" - } - } + "installsAfter": [ + "ghcr.io/devcontainers/features/go" + ] } \ No newline at end of file diff --git a/src/goreportcard/NOTES.md b/src/goreportcard/NOTES.md index 05904d8..75ac9fd 100644 --- a/src/goreportcard/NOTES.md +++ b/src/goreportcard/NOTES.md @@ -1,3 +1,20 @@ +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/goreportcard:1": {} + } +} +``` + ## OS Support Tested only with diff --git a/src/goreportcard/README.md b/src/goreportcard/README.md index 963664d..1a6e0e8 100644 --- a/src/goreportcard/README.md +++ b/src/goreportcard/README.md @@ -7,12 +7,29 @@ provides goreportcard-cli. ```json "features": { - "ghcr.io/thediveo/devcontainer-features/goreportcard:0": {} + "ghcr.io/thediveo/devcontainer-features/goreportcard:1": {} } ``` +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/thediveo/devcontainer-features/goreportcard:1": {} + } +} +``` + ## OS Support Tested only with diff --git a/src/goreportcard/devcontainer-feature.json b/src/goreportcard/devcontainer-feature.json index 0f72b83..92da4ed 100644 --- a/src/goreportcard/devcontainer-feature.json +++ b/src/goreportcard/devcontainer-feature.json @@ -1,12 +1,14 @@ { "name": "Go Report Card", "id": "goreportcard", - "version": "0.1.1", + "version": "1.0.0", + "keywords": [ + "go", + "goreportcard", + "score card" + ], "description": "provides goreportcard-cli.", - "dependsOn": { - "ghcr.io/devcontainers/features/go:1": { - "version": "latest", - "golangciLintVersion": "latest" - } - } + "installsAfter": [ + "ghcr.io/devcontainers/features/go" + ] } \ No newline at end of file diff --git a/src/local-pkgsite/NOTES.md b/src/local-pkgsite/NOTES.md index 728da48..fc4f590 100644 --- a/src/local-pkgsite/NOTES.md +++ b/src/local-pkgsite/NOTES.md @@ -1,3 +1,24 @@ +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +Similar, it has a soft dependency on `ghcr.io/devcontainers/features/node` – +depending on you base image you already have a suitable node, otherwise you +might want to use the aforementioned node feature. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/devcontainers/features/node:2": {}, // optional + "ghcr.io/thediveo/devcontainer-features/local-pkgsite:1": {} + } +} +``` ## OS Support Tested with: diff --git a/src/local-pkgsite/README.md b/src/local-pkgsite/README.md index ffaf7e2..3aa5213 100644 --- a/src/local-pkgsite/README.md +++ b/src/local-pkgsite/README.md @@ -7,7 +7,7 @@ A local Go pkgsite serving the module documentation, with automatic browser refr ```json "features": { - "ghcr.io/thediveo/devcontainer-features/local-pkgsite:0": {} + "ghcr.io/thediveo/devcontainer-features/local-pkgsite:1": {} } ``` @@ -19,6 +19,27 @@ A local Go pkgsite serving the module documentation, with automatic browser refr | reload-delay | time in milliseconds to delay the reload event following file changes | string | 2000 | | reload-debounce | time in milliseconds to restrict the frequency in which browser:reload events can be emitted to connected clients | string | 5000 | +## Feature Dependency + +This feature has only a soft dependecy on `ghcr.io/devcontainers/features/go` so +that you have full control over from where and how you bring in the go +toolchain. + +Similar, it has a soft dependency on `ghcr.io/devcontainers/features/node` – +depending on you base image you already have a suitable node, otherwise you +might want to use the aforementioned node feature. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/go:1": {}, + "ghcr.io/devcontainers/features/node:2": {}, // optional + "ghcr.io/thediveo/devcontainer-features/local-pkgsite:1": {} + } +} +``` ## OS Support Tested with: diff --git a/src/local-pkgsite/devcontainer-feature.json b/src/local-pkgsite/devcontainer-feature.json index 97607eb..e039ef2 100644 --- a/src/local-pkgsite/devcontainer-feature.json +++ b/src/local-pkgsite/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Local Go Pkgsite", "id": "local-pkgsite", - "version": "0.1.5", + "version": "1.0.0", "description": "A local Go pkgsite serving the module documentation, with automatic browser refresh.", "options": { "port": { @@ -23,14 +23,9 @@ "default": "5000" } }, - "dependsOn": { - "ghcr.io/devcontainers/features/go:1": { - "version": "latest", - "golangciLintVersion": "latest" - }, - "ghcr.io/devcontainers/features/node:1": { - "version": "lts" - } - }, + "installsAfter": [ + "ghcr.io/devcontainers/features/node", + "ghcr.io/devcontainers/features/go" + ], "postStartCommand": "/usr/local/bin/pkgsite-serve" } \ No newline at end of file diff --git a/src/pull-through-cache-registry/NOTES.md b/src/pull-through-cache-registry/NOTES.md index 4fa1116..0795336 100644 --- a/src/pull-through-cache-registry/NOTES.md +++ b/src/pull-through-cache-registry/NOTES.md @@ -10,11 +10,24 @@ In the best tradition of [dogfooding](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) we use this feature to develop our features. -## Important -- this feature depends on `ghcr.io/devcontainers/features/docker-in-docker:3`. -- at this time, it needs to set the docker-in-docker configuration parameter - `moby` to `false` in order to work on Debian 13 as well as Ubuntu 26.04. +## Feature Dependency + +This feature has only a soft dependecy on +`ghcr.io/devcontainers/features/docker-in-docker` so that you have full control +over from where and how you bring in Docker-in-Docker. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:3": { + "moby": false + }, + } +} +``` ## OS Support diff --git a/src/pull-through-cache-registry/README.md b/src/pull-through-cache-registry/README.md index 3d1f7b9..b9d849c 100644 --- a/src/pull-through-cache-registry/README.md +++ b/src/pull-through-cache-registry/README.md @@ -7,7 +7,7 @@ Deploys a devcontainer-local CNCF Distribution Registry configured as a pull-thr ```json "features": { - "ghcr.io/thediveo/devcontainer-features/pull-through-cache-registry:0": {} + "ghcr.io/thediveo/devcontainer-features/pull-through-cache-registry:1": {} } ``` @@ -33,6 +33,25 @@ In the best tradition of [dogfooding](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) we use this feature to develop our features. + +## Feature Dependency + +This feature has only a soft dependecy on +`ghcr.io/devcontainers/features/docker-in-docker` so that you have full control +over from where and how you bring in Docker-in-Docker. + +For example: + +```json +{ + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:3": { + "moby": false + }, + } +} +``` + ## OS Support As this feature relies on the [Docker-in-Docker diff --git a/src/pull-through-cache-registry/devcontainer-feature.json b/src/pull-through-cache-registry/devcontainer-feature.json index 9e5557d..c9853d5 100644 --- a/src/pull-through-cache-registry/devcontainer-feature.json +++ b/src/pull-through-cache-registry/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "OCI registry pull-through cache to mirror rate-limited upstream registries, such as Docker Hub", "id": "pull-through-cache-registry", - "version": "0.2.0", + "version": "1.0.0", "description": "Deploys a devcontainer-local CNCF Distribution Registry configured as a pull-through cache for the local docker-in-docker", "documentationURL": "https://github.com/thediveo/devcontainer-features/blob/master/src/registry-pull-through-cache/README.md", "options": { @@ -14,13 +14,19 @@ "type": "string", "default": "5000", "description": "port to bind the CNCF Distribution Registry service to.", - "proposals": ["5000", "9999"] + "proposals": [ + "5000", + "9999" + ] }, "ttl": { "type": "string", "default": "168h", "description": "expire proxy cache storage after this duration, 168h corresponds with 7 days by default, set to 0 to disable any expiration. Valid duration suffixes are s, m, h, without suffix nanoseconds are assumed.", - "proposals": ["24h", "168h"] + "proposals": [ + "24h", + "168h" + ] }, "registry-name": { "type": "string", @@ -41,9 +47,7 @@ } ], "postCreateCommand": "/usr/local/bin/registry-pull-through-cache", - "dependsOn": { - "ghcr.io/devcontainers/features/docker-in-docker:3": { - "moby": false - } - } -} + "installsAfter": [ + "ghcr.io/devcontainers/features/docker-in-docker" + ] +} \ No newline at end of file diff --git a/src/pull-through-cache-registry/install.sh b/src/pull-through-cache-registry/install.sh index 4b582d0..20c340b 100755 --- a/src/pull-through-cache-registry/install.sh +++ b/src/pull-through-cache-registry/install.sh @@ -38,7 +38,9 @@ if docker ps -a --format '{{.Names}}' | grep -q "^\${REGISTRY_NAME}$"; then docker start "\${REGISTRY_NAME}" else echo "running pull-through cache registry container" + docker pull registry-1.docker.io/library/registry:3 docker run -d \ + --pull never \ --restart always \ --name "\${REGISTRY_NAME}" \ -p \${PORT}:5000 \ @@ -47,7 +49,7 @@ else -e REGISTRY_HTTP_DEBUG= \ -e REGISTRY_LOG_LEVEL=info \ -e OTEL_TRACES_EXPORTER=none \ - registry:3 + registry-1.docker.io/library/registry:3 fi echo "pull-through cache registry started" EOF diff --git a/test/bpftool/almalinux.sh b/test/bpftool/almalinux.sh index d4e56d7..59f7c4d 100644 --- a/test/bpftool/almalinux.sh +++ b/test/bpftool/almalinux.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/bpftool/alpine.sh b/test/bpftool/alpine.sh index d4e56d7..59f7c4d 100644 --- a/test/bpftool/alpine.sh +++ b/test/bpftool/alpine.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/bpftool/debian.sh b/test/bpftool/debian.sh index d4e56d7..59f7c4d 100644 --- a/test/bpftool/debian.sh +++ b/test/bpftool/debian.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/bpftool/test.sh b/test/bpftool/default.sh similarity index 100% rename from test/bpftool/test.sh rename to test/bpftool/default.sh diff --git a/test/bpftool/fedora.sh b/test/bpftool/fedora.sh index d4e56d7..59f7c4d 100644 --- a/test/bpftool/fedora.sh +++ b/test/bpftool/fedora.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/bpftool/scenarios.json b/test/bpftool/scenarios.json index af75017..4dd5870 100644 --- a/test/bpftool/scenarios.json +++ b/test/bpftool/scenarios.json @@ -1,6 +1,12 @@ { + "default": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "bpftool": { } + } + }, "v7.4.0": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "bpftool": { "version": "v7.4.0" @@ -8,7 +14,7 @@ } }, "almalinux": { - "image": "ghcr.io/almalinux/almalinux:9", + "image": "ghcr.io/almalinux/almalinux:10", "features": { "bpftool": {} } @@ -20,7 +26,7 @@ } }, "debian": { - "image": "mcr.microsoft.com/devcontainers/base:debian-12", + "image": "mcr.microsoft.com/devcontainers/base:debian-13", "features": { "bpftool": {} } diff --git a/test/bpftool/v7.4.0.sh b/test/bpftool/v7.4.0.sh index d4e56d7..59f7c4d 100644 --- a/test/bpftool/v7.4.0.sh +++ b/test/bpftool/v7.4.0.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/cni-plugins/almalinux.sh b/test/cni-plugins/almalinux.sh index d4e56d7..59f7c4d 100644 --- a/test/cni-plugins/almalinux.sh +++ b/test/cni-plugins/almalinux.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/cni-plugins/debian.sh b/test/cni-plugins/debian.sh index 67ae783..abf0a0a 100644 --- a/test/cni-plugins/debian.sh +++ b/test/cni-plugins/debian.sh @@ -3,4 +3,4 @@ set -e PORT=6666 -. ./test.sh +. ./default.sh diff --git a/test/cni-plugins/test.sh b/test/cni-plugins/default.sh similarity index 100% rename from test/cni-plugins/test.sh rename to test/cni-plugins/default.sh diff --git a/test/cni-plugins/fedora.sh b/test/cni-plugins/fedora.sh index d4e56d7..59f7c4d 100644 --- a/test/cni-plugins/fedora.sh +++ b/test/cni-plugins/fedora.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/cni-plugins/other-location.sh b/test/cni-plugins/other-location.sh index 3d93415..59ee63a 100644 --- a/test/cni-plugins/other-location.sh +++ b/test/cni-plugins/other-location.sh @@ -2,4 +2,4 @@ set -e PLUGINS_PATH="/opt/cni/bin" -. ./test.sh +. ./default.sh diff --git a/test/cni-plugins/scenarios.json b/test/cni-plugins/scenarios.json index b7c1520..81150d6 100644 --- a/test/cni-plugins/scenarios.json +++ b/test/cni-plugins/scenarios.json @@ -1,6 +1,12 @@ { + "default": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "cni-plugins": {} + } + }, "other-location": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "features": { "cni-plugins": { "plugins-path": "/opt/cni/bin" @@ -8,13 +14,13 @@ } }, "almalinux": { - "image": "ghcr.io/almalinux/almalinux:9", + "image": "ghcr.io/almalinux/almalinux:10", "features": { "cni-plugins": {} } }, "debian": { - "image": "mcr.microsoft.com/devcontainers/base:debian-12", + "image": "mcr.microsoft.com/devcontainers/base:debian-13", "features": { "cni-plugins": {} } diff --git a/test/docsify/almalinux.sh b/test/docsify/almalinux.sh index d4e56d7..59f7c4d 100644 --- a/test/docsify/almalinux.sh +++ b/test/docsify/almalinux.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -. ./test.sh +. ./default.sh diff --git a/test/docsify/alpine.sh b/test/docsify/alpine.sh deleted file mode 100644 index d4e56d7..0000000 --- a/test/docsify/alpine.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -e - -. ./test.sh diff --git a/test/docsify/default.sh b/test/docsify/default.sh new file mode 100755 index 0000000..4ede9a5 --- /dev/null +++ b/test/docsify/default.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash + +# This is a slightly overachieving test that ensures that when there's no +# index.html present in the directory docsify is supposed to serve from a proper +# fallback fake site is generated during start up and correctly served. + +set -e + +source dev-container-features-test-lib + +CMD=$(cat </dev/null 2>&1; then + SUDO="sudo" +else + SUDO="" +fi + +install_browser_deps() { + if command -v apt-get >/dev/null 2>&1; then + echo "detected Debian/Ubuntu" + + sudo apt-get update + wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] https://dl-ssl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google.list + sudo apt-get update + DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-freefont-ttf libxss1 dbus dbus-x11 --no-install-recommends + CHROMIUMPATH=/usr/bin/google-chrome-stable + + elif command -v dnf >/dev/null 2>&1; then + echo "detected RHEL/Alma/Rocky/Fedora" + + $SUDO dnf install -y epel-release || true + $SUDO dnf install -y chromium + CHROMIUMPATH="$(command -v chromium-browser)" + + else + echo "Unsupported distro" + exit 1 + fi +} + +install_browser_deps + +echo "installing puppeteer..." +PUPPETEER_SKIP_DOWNLOAD=true npm install puppeteer --save + +SCRIPT=$(cat <