A Docker image with the .NET 10 SDK, git, and npm, reachable over SSH with key-only auth.
Dockerfile— builds onmcr.microsoft.com/dotnet/sdk:10.0, adds git, Node.js/npm (via NodeSource), anopenssh-server, and a non-rootdevuser with passwordless sudo.entrypoint.sh— runs inside the Linux container at startup (generates SSH host keys on first boot, then execssshd). Left as bash intentionally — it's container-internal, not something you run yourself, and bash is guaranteed present in the base image while PowerShell is not.generate-keys.ps1— run on your machine. Creates a dedicated ed25519 keypair (~/.ssh/id_dotnet10dev_ed25519by default) and copies the public half into this folder asauthorized_keys, which the Dockerfile bakes into the image.up.ps1— builds the image and starts the container, publishing SSH onlocalhost:2222.down.ps1— stops and removes the container.
All host-side scripts are PowerShell Core (pwsh) — install it if you
don't have it (winget install Microsoft.PowerShell / brew install powershell / etc.).
-
Generate the SSH keypair (do this wherever you'll build/run the container):
./generate-keys.ps1
This never sets a password — auth is key-only.
-
Build and start the container:
./up.ps1 -
Connect over SSH:
ssh -i ~/.ssh/id_dotnet10dev_ed25519 -p 2222 dev@localhost
- **Host**: `localhost` (port `2222` is mapped to the container's `22`;
change with `up.ps1 -SshPort <port>` if 2222 is taken)
- **User**: `dev` (passwordless sudo inside the container)
4. **Verify the tooling** once connected:
```bash
dotnet --version # should report a 10.x SDK
git --version
npm --version
- Tear down when done:
./down.ps1
PasswordAuthenticationis disabled insshd_config— key-only login, per your earlier choice.- The Node.js major version is a build arg:
docker build --build-arg NODE_MAJOR=24 ...if you'd rather track the newer LTS instead of the default (22). authorized_keysis gitignored — don't commit it or the private key if this folder ever becomes a git repo.- If you're running Docker Desktop on a remote/VM host rather than
locally, swap
localhostfor that host's address in the SSH command.