Skip to content

Commit

Permalink
[docker-in-docker] - issue devcontainers#1202 solution - moby=false, …
Browse files Browse the repository at this point in the history
…holds configured docker-ce and docker-ce-cli version (devcontainers#1215)

* [docker-in-docker] - issue devcontainers#1202 solution - moby=false, holds configured docker-ce and docker-ce-cli version

* test case for scenario of issue

---------

Co-authored-by: Daniel Doyle <[email protected]>
  • Loading branch information
gauravsaini04 and ddoyle2017 authored Jan 28, 2025
1 parent 28b75a6 commit c31723d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/docker-in-docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ else
else
apt-get -y install --no-install-recommends docker-ce-cli${cli_version_suffix} docker-ce${engine_version_suffix}
# Install compose
apt-mark hold docker-ce docker-ce-cli
apt-get -y install --no-install-recommends docker-compose-plugin || echo "(*) Package docker-compose-plugin (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping."
fi
fi
Expand Down
10 changes: 10 additions & 0 deletions test/docker-in-docker/pin_docker-ce_version_moby_false.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

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

check "docker-ce" bash -c "docker --version"
check "docker-ce-cli" bash -c "docker version"

#report result
reportResults
16 changes: 16 additions & 0 deletions test/docker-in-docker/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@
}
}
},
"pin_docker-ce_version_moby_false": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
"features": {
"docker-in-docker": {
"version": "26.1.4",
"moby": "false",
"mobyBuildxVersion": "latest",
"dockerDashComposeVersion": "none",
"azureDnsAutoDetection": "true",
"dockerDefaultAddressPool": "",
"installDockerBuildx": "true",
"installDockerComposeSwitch": "true",
"disableIp6tables": "false"
}
}
},
// DO NOT REMOVE: This scenario is used by the docker-in-docker-stress-test workflow
"docker_with_on_create_command": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
Expand Down

0 comments on commit c31723d

Please sign in to comment.