Skip to content

Commit

Permalink
Docker-in-docker - [Bug fix] : Fix externally-managed-environment pyt…
Browse files Browse the repository at this point in the history
…hon error for "bookworm" (#833)

* Docker-in-docker - [Bug fix] : Fix externally-managed-environment python error for "bookworm"

* add comment
  • Loading branch information
samruddhikhandale authored Feb 8, 2024
1 parent 08fb370 commit d5ef6a7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/docker-in-docker/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "docker-in-docker",
"version": "2.8.0",
"version": "2.8.1",
"name": "Docker (Docker-in-Docker)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker",
"description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.",
Expand Down
3 changes: 2 additions & 1 deletion src/docker-in-docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ if [ "${DOCKER_DASH_COMPOSE_VERSION}" != "none" ]; then
if [ "${target_compose_arch}" = "amd64" ]; then
target_compose_arch="x86_64"
fi
if [ "${target_compose_arch}" != "x86_64" ]; then
# https://github.com/devcontainers/features/issues/832
if [ "${target_compose_arch}" != "x86_64" ] && [ "${VERSION_CODENAME}" != "bookworm" ]; then
# Use pip to get a version that runs on this architecture
check_packages python3-minimal python3-pip libffi-dev python3-venv
export PIPX_HOME=/usr/local/pipx
Expand Down
22 changes: 22 additions & 0 deletions test/docker-in-docker/docker_python_bookworm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

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

# Definition specific tests
check "docker-buildx" bash -c "docker buildx version"
check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx"

check "docker-buildx" docker buildx version
check "docker-build" docker build ./

check "installs docker-compose v2 install" bash -c "type docker-compose"
check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'"
check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'"

check "installs compose-switch as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]"

# Report result
reportResults
10 changes: 10 additions & 0 deletions test/docker-in-docker/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@
}
}
},
"docker_python_bookworm": {
"image": "mcr.microsoft.com/devcontainers/base:bookworm",
"features": {
"docker-in-docker": {
"moby": true,
"installDockerBuildx": true,
"dockerDashComposeVersion": "v2"
}
}
},
// 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 d5ef6a7

Please sign in to comment.