Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-24.04 .
devcontainer features test -f lazygit -i mcr.microsoft.com/devcontainers/base:ubuntu -p .
```

- `--skip-scenarios` ... tests only the `test.sh` test case, but no scenario tests.
Expand Down
6 changes: 6 additions & 0 deletions src/pull-through-cache-registry/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ 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.

## OS Support

As this feature relies on the [Docker-in-Docker
Expand Down
4 changes: 3 additions & 1 deletion src/pull-through-cache-registry/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
],
"postCreateCommand": "/usr/local/bin/registry-pull-through-cache",
"dependsOn": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
"ghcr.io/devcontainers/features/docker-in-docker:3": {
"moby": false
}
}
}
9 changes: 6 additions & 3 deletions src/pull-through-cache-registry/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ WAIT=${WAIT:-30}
echo "installing feature registry-pull-through-cache"

cat <<EOF >"${REGISTRYDEPLOYSCRIPT_PATH}"
PROXY_REMOTE_URL=${PROXY_REMOTE_URL}
#!/bin/bash
set -eu

PROXY_REMOTE_URL="${PROXY_REMOTE_URL}"
PORT="${PORT}"
TTL="${TTL}"
REGISTRY_NAME="${REGISTRY_NAME}"
Expand All @@ -23,8 +26,8 @@ timeout=${WAIT}
echo "waiting up to ${WAIT}s for Docker daemon to become responsive..."
while ! docker ps >/dev/null 2>&1; do
sleep 1
timeout=$((timeout-1))
if [ "$timeout" -le 0 ]; then
timeout=\$((timeout-1))
if [ "\$timeout" -le 0 ]; then
echo "Docker did not become responsive, aborting"
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions test/pull-through-cache-registry/scenarios.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"9999": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"pull-through-cache-registry": {
"port": "9999"
}
}
},
"quay.io": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"pull-through-cache-registry": {
"proxy-remote-url": "https://quay.io"
Expand Down
Loading