Spaces:
Sleeping
Sleeping
Make a codespace built from this image debuggable
Browse filesThe image has no SSH server, so gh codespace ssh and gh codespace logs both
refuse. A codespace whose server fails to start is then a black box: the log the
entrypoint writes cannot be read by any means the CLI offers. The sshd feature
costs nothing at runtime and is what makes a failure diagnosable.
Also detaches the server with setsid. postStartCommand's shell exits as soon as it
returns, and a plain background job is not guaranteed to outlive it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
.devcontainer/devcontainer.json
CHANGED
|
@@ -15,6 +15,14 @@
|
|
| 15 |
"dockerfile": "../Dockerfile"
|
| 16 |
},
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
// uid 1000, matching the image. The Dockerfile creates nothing else.
|
| 19 |
"remoteUser": "node",
|
| 20 |
|
|
@@ -48,7 +56,9 @@
|
|
| 48 |
// behave like a server rather than a dev box you have to log into and restart by hand.
|
| 49 |
// Backgrounded so the codespace can finish starting; the log is where a refused boot
|
| 50 |
// (usually a missing password) explains itself.
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
|
| 53 |
"customizations": {
|
| 54 |
"vscode": {
|
|
|
|
| 15 |
"dockerfile": "../Dockerfile"
|
| 16 |
},
|
| 17 |
|
| 18 |
+
// The image ships no SSH server, and without one `gh codespace ssh` and `gh codespace logs`
|
| 19 |
+
// both refuse — so a codespace that fails to start the server cannot be inspected at all.
|
| 20 |
+
// This costs nothing at runtime and is the difference between a debuggable box and a black
|
| 21 |
+
// one.
|
| 22 |
+
"features": {
|
| 23 |
+
"ghcr.io/devcontainers/features/sshd:1": {}
|
| 24 |
+
},
|
| 25 |
+
|
| 26 |
// uid 1000, matching the image. The Dockerfile creates nothing else.
|
| 27 |
"remoteUser": "node",
|
| 28 |
|
|
|
|
| 56 |
// behave like a server rather than a dev box you have to log into and restart by hand.
|
| 57 |
// Backgrounded so the codespace can finish starting; the log is where a refused boot
|
| 58 |
// (usually a missing password) explains itself.
|
| 59 |
+
// setsid detaches the server from the shell that postStartCommand runs in, which exits as
|
| 60 |
+
// soon as it returns; a plain background job is not guaranteed to outlive it.
|
| 61 |
+
"postStartCommand": "setsid nohup /home/node/entrypoint.sh > /tmp/opencode.log 2>&1 < /dev/null & echo started",
|
| 62 |
|
| 63 |
"customizations": {
|
| 64 |
"vscode": {
|