From 5e11f9728cc01e9a853688dd54583f29533a5c3e Mon Sep 17 00:00:00 2001 From: Wade Barnes Date: Mon, 22 Jul 2024 12:37:05 -0700 Subject: [PATCH] Switch to docker-from-docker - Allows the dev container to share the host's docker instance, allowing the host to see any containers launched in the dev container. Signed-off-by: Wade Barnes --- .devcontainer/devcontainer.json | 7 +++++-- docker/docker-compose.yaml | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9c5c72b0..f94e143c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,7 @@ "ghcr.io/devcontainers/features/dotnet:2": {}, "ghcr.io/devcontainers/features/aws-cli:1": {}, "ghcr.io/devcontainers/features/terraform:1": {}, - "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/docker-from-docker:1.5.0": {}, "ghcr.io/devcontainers-contrib/features/aws-cdk:2": {} }, "customizations": { @@ -31,5 +31,8 @@ } } }, - "remoteUser": "root" + "remoteUser": "root", + "containerEnv": { + "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" + } } diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index d4ca2069..feb94b7e 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -27,8 +27,8 @@ services: ports: - 8080:1339 volumes: - - "../web/src:/opt/app-root/src/src" - - "../web/package.json:/opt/app-root/src/package.json" + - "${LOCAL_WORKSPACE_FOLDER-..}/web/src:/opt/app-root/src/src" + - "${LOCAL_WORKSPACE_FOLDER-..}/web/package.json:/opt/app-root/src/package.json" depends_on: - api