Skip to content
Merged
2 changes: 1 addition & 1 deletion src/docker-outside-of-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Re-use the host docker socket, adding the Docker CLI to a container. Feature inv
| version | Select or enter a Docker/Moby CLI version. (Availability can vary by OS version.) | string | latest |
| moby | Install OSS Moby build instead of Docker CE | boolean | true |
| mobyBuildxVersion | Install a specific version of moby-buildx when using Moby | string | latest |
| dockerDashComposeVersion | Compose version to use for docker-compose (v1 or v2 or none) | string | v2 |
| dockerDashComposeVersion | Compose version to use for docker-compose (v1 or v2 or none or latest) | string | latest |
| installDockerBuildx | Install Docker Buildx | boolean | true |
| installDockerComposeSwitch | Install Compose Switch (provided docker compose is available) which is a replacement to the Compose V1 docker-compose (python) executable. It translates the command line into Compose V2 docker compose then runs the latter. | boolean | true |

Expand Down
8 changes: 5 additions & 3 deletions src/docker-outside-of-docker/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{

"id": "docker-outside-of-docker",
"version": "1.8.0",
"version": "1.9.0",
"name": "Docker (docker-outside-of-docker)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker",
"description": "Re-use the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.",
Expand Down Expand Up @@ -29,11 +30,12 @@
"type": "string",
"enum": [
"none",
"latest",
"v1",
"v2"
],
"default": "v2",
"description": "Compose version to use for docker-compose (v1 or v2 or none)"
"default": "latest",
"description": "Compose version to use for docker-compose (v1 or v2 or none or latest)"
},
"installDockerBuildx": {
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion src/docker-outside-of-docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DOCKER_VERSION="${VERSION:-"latest"}"
USE_MOBY="${MOBY:-"true"}"
MOBY_BUILDX_VERSION="${MOBYBUILDXVERSION:-"latest"}"
DOCKER_DASH_COMPOSE_VERSION="${DOCKERDASHCOMPOSEVERSION:-"v2"}" # v1 or v2 or none
DOCKER_DASH_COMPOSE_VERSION="${DOCKERDASHCOMPOSEVERSION:-"latest"}" # v1 or v2 or none or latest

ENABLE_NONROOT_DOCKER="${ENABLE_NONROOT_DOCKER:-"true"}"
SOURCE_SOCKET="${SOURCE_SOCKET:-"/var/run/docker-host.sock"}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

# Definition specific tests
check "docker compose" bash -c "docker compose version | grep -E '5.[0-9]+.[0-9]+'"
check "docker-compose" bash -c "docker-compose --version | grep -E '5.[0-9]+.[0-9]+'"
check "installs compose-switch as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]"

# Report result
reportResults
20 changes: 20 additions & 0 deletions test/docker-outside-of-docker/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,25 @@
"moby": false
}
}
},
"docker_dash_compose_latest_moby": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
"docker-outside-of-docker": {
"moby": true,
"dockerDashComposeVersion": "latest"
}
},
"containerUser": "vscode"
},
"docker_dash_compose_latest_no_moby": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
"docker-outside-of-docker": {
"moby": false,
"dockerDashComposeVersion": "latest"
}
},
"containerUser": "vscode"
}
}
Loading