From 8b00bef6c2bee1201dc61d2e859ffe8c7009d549 Mon Sep 17 00:00:00 2001 From: John Schaeffer Date: Mon, 13 Mar 2023 23:01:54 +0000 Subject: [PATCH] Add sshd feature and SSH support to dev container This commit adds the sshd feature to the permissions-api dev container, allowing users to access it through SSH rather than `docker exec` or similar tools. Signed-off-by: John Schaeffer --- .devcontainer/devcontainer.json | 4 ++-- .devcontainer/docker-compose.yml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index af4a0a78..49250dd6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -28,13 +28,13 @@ ] } }, - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", "remoteEnv": { "PATH": "${containerEnv:PATH}:/home/vscode/.nsccli/bin" }, "features": { + "ghcr.io/devcontainers/features/sshd:1": {}, "git": "latest" } -} \ No newline at end of file +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 912a1b53..c1ebfb4f 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -16,10 +16,17 @@ services: VARIANT: 1.19-bullseye NODE_VERSION: "none" command: sleep infinity +# uncomment along with bind volume to use SSH for dev container access +# ports: +# - "127.0.0.1:2224:2222" env_file: - .env volumes: - ..:/workspace:cached +# - type: bind +# source: ~/.ssh/authorized_keys +# target: /home/vscode/.ssh/authorized_keys +# read_only: true networks: - infradev # Use "forwardPorts" in **devcontainer.json** to forward a port locally.