Skip to content
Draft
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 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this test script is duplicated from existing test scripts, can we please create a symlink to the original script instead of duplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this test script for Docker Compose latest(5.x.x); retained unchanged as only version differs. Created symlink to align with existing 'latest' script."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sireeshajonnalagadda I don't see changes on this file though. Could you please convert this to symlink as well if its a duplicated copy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kaniska244
The checks are structurally identical, with the only difference being the regex used to validate Docker Compose version 5 instead of version 2. To avoid duplication, a symlink has been created from one of the 'latest' scripts to align with the other 'latest' script without Moby.

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"
}
}