Skip to content

Commit f851b48

Browse files
authored
[Docker-in-Docker] - Update docker-compose to the latest version (#1672)
* [Docker-in-Docker] - Update docker-compose to the latest version * Implement review comment.
1 parent a8f0b45 commit f851b48

6 files changed

Lines changed: 56 additions & 5 deletions

File tree

src/docker-in-docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Create child containers *inside* a container, independent from the host's docker
1818
| version | Select or enter a Docker/Moby Engine version. (Availability can vary by OS version.) | string | latest |
1919
| moby | Install OSS Moby build instead of Docker CE | boolean | true |
2020
| mobyBuildxVersion | Install a specific version of moby-buildx when using Moby | string | latest |
21-
| dockerDashComposeVersion | Default version of Docker Compose (v1, v2 or none) | string | v2 |
21+
| dockerDashComposeVersion | Default version of Docker Compose (v1, v2, latest or none) | string | latest |
2222
| azureDnsAutoDetection | Allow automatically setting the dockerd DNS server when the installation script detects it is running in Azure | boolean | true |
2323
| dockerDefaultAddressPool | Define default address pools for Docker networks. e.g. base=192.168.0.0/16,size=24 | string | - |
2424
| installDockerBuildx | Install Docker Buildx | boolean | true |

src/docker-in-docker/devcontainer-feature.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-in-docker",
3-
"version": "3.0.1",
3+
"version": "3.1.0",
44
"name": "Docker (Docker-in-Docker)",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker",
66
"description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.",
@@ -29,11 +29,12 @@
2929
"type": "string",
3030
"enum": [
3131
"none",
32+
"latest",
3233
"v1",
3334
"v2"
3435
],
35-
"default": "v2",
36-
"description": "Default version of Docker Compose (v1, v2 or none)"
36+
"default": "latest",
37+
"description": "Default version of Docker Compose (v1, v2, latest or none)"
3738
},
3839
"azureDnsAutoDetection": {
3940
"type": "boolean",

src/docker-in-docker/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DOCKER_VERSION="${VERSION:-"latest"}" # The Docker/Moby Engine + CLI should match in version
1212
USE_MOBY="${MOBY:-"true"}"
1313
MOBY_BUILDX_VERSION="${MOBYBUILDXVERSION:-"latest"}"
14-
DOCKER_DASH_COMPOSE_VERSION="${DOCKERDASHCOMPOSEVERSION:-"v2"}" #v1, v2 or none
14+
DOCKER_DASH_COMPOSE_VERSION="${DOCKERDASHCOMPOSEVERSION:-"latest"}" #v1, v2, latest or none
1515
AZURE_DNS_AUTO_DETECTION="${AZUREDNSAUTODETECTION:-"true"}"
1616
DOCKER_DEFAULT_ADDRESS_POOL="${DOCKERDEFAULTADDRESSPOOL:-""}"
1717
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "docker compose" bash -c "docker compose version | grep -E '[0-9]+\.[0-9]+\.[0-9]+'"
10+
check "docker-compose" bash -c "docker-compose --version | grep -E '[0-9]+\.[0-9]+\.[0-9]+'"
11+
check "installs compose as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]"
12+
check "moby-engine" bash -c "dpkg-query -W moby-engine"
13+
check "moby-cli" bash -c "dpkg-query -W moby-cli"
14+
15+
# Report result
16+
reportResults
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "docker compose" bash -c "docker compose version | grep -E '[0-9]+\.[0-9]+\.[0-9]+'"
10+
check "docker-compose" bash -c "docker-compose --version | grep -E '[0-9]+\.[0-9]+\.[0-9]+'"
11+
check "installs compose as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]"
12+
13+
# Report result
14+
reportResults

test/docker-in-docker/scenarios.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,26 @@
146146
}
147147
}
148148
},
149+
"docker_compose_latest_moby": {
150+
"image": "mcr.microsoft.com/devcontainers/base:noble",
151+
"features": {
152+
"docker-in-docker": {
153+
"moby": true,
154+
"installDockerBuildx": true,
155+
"dockerDashComposeVersion": "latest"
156+
}
157+
}
158+
},
159+
"docker_compose_latest_no_moby": {
160+
"image": "mcr.microsoft.com/devcontainers/base:noble",
161+
"features": {
162+
"docker-in-docker": {
163+
"moby": false,
164+
"installDockerBuildx": true,
165+
"dockerDashComposeVersion": "latest"
166+
}
167+
}
168+
},
149169
"docker_build_fallback_buildx": {
150170
"image": "ubuntu:noble",
151171
"features": {

0 commit comments

Comments
 (0)