Skip to content

Commit

Permalink
Add sshd feature and SSH support to dev container
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jnschaeffer committed Mar 13, 2023
1 parent 0a66e94 commit 108792e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
6 changes: 6 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ services:
VARIANT: 1.19-bullseye
NODE_VERSION: "none"
command: sleep infinity
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.
Expand Down

0 comments on commit 108792e

Please sign in to comment.