From 618967eb90b8523e97cb6ecadab4b14c7a9f0f01 Mon Sep 17 00:00:00 2001 From: r-richmond Date: Sun, 9 Oct 2022 21:13:28 -0700 Subject: [PATCH] Configure vscode dev-container (#26958) --- .devcontainer/devcontainer.json | 7 ++++++- scripts/ci/docker-compose/devcontainer.yml | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6ee0d782883ae..faf30cdd7e686 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,5 +21,10 @@ "rogalmic.bash-debug" ], "service": "airflow", - "forwardPorts": [8080,5555,5432,6379] + "forwardPorts": [8080, 5555, 5432, 6379], + "workspaceFolder": "/opt/airflow", + // for users who use non-standard git config patterns + // https://github.com/microsoft/vscode-remote-release/issues/2084#issuecomment-989756268 + "initializeCommand": "cd \"${localWorkspaceFolder}\" && git config --local user.email \"$(git config user.email)\" && git config --local user.name \"$(git config user.name)\"", + "overrideCommand": true } diff --git a/scripts/ci/docker-compose/devcontainer.yml b/scripts/ci/docker-compose/devcontainer.yml index ee4ba3fc471c0..e7f013684c375 100644 --- a/scripts/ci/docker-compose/devcontainer.yml +++ b/scripts/ci/docker-compose/devcontainer.yml @@ -32,7 +32,8 @@ services: volumes: # Pass docker to inside of the container so that Kind and Moto tests can use it. - /var/run/docker.sock:/var/run/docker.sock - - /dev/urandom:/dev/random # Required to get non-blocking entropy source + - /dev/urandom:/dev/random # Required to get non-blocking entropy source # Mount the cloned repo from codspaces docker host into the container, # this will keep /workspaces/airflow and /opt/airflow in sync. - - /var/lib/docker/codespacemount/workspace/airflow:/opt/airflow + - ../../../.:/opt/airflow + # - /var/lib/docker/codespacemount/workspace/airflow:/opt/airflow