Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

With the recent release (the one with features) I tried experimenting with the devcontainers CLI. But I just can't get the forwardPorts feature to work. I created the following minimal devcontainer.json file: api-url #1248

Open
Frankramos181422 opened this issue Sep 22, 2022 · 0 comments

Comments

@Frankramos181422
Copy link

With the recent release (the one with features) I tried experimenting with the devcontainers CLI. But I just can't get the forwardPorts feature to work. I created the following minimal devcontainer.json file:

{
  "name": "my-project-devcontainer",
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/devcontainers/features/sshd:1": {
      "version": "latest"
    }
  },
  "forwardPorts": [2222],
  "remoteUser": "vscode"
}

Maybe I am misunderstanding the forwardPorts option, but I would expect that this configuration will forward the port 2222 (this is the default defined by the sshd feature) from the devcontainer to my host. But a simple ssh localhost -p 2222 did not work.

I tried this on Windows 11.

Originally posted by @davidkron in devcontainers/cli#186

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant