Skip to content

Commit 18efc55

Browse files
Add troubleshooting section with exposing-ports sub-section to containers local-dev docs
1 parent 9438dd3 commit 18efc55

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/content/docs/containers/local-dev.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,24 @@ You may prefer to set up your own code watchers and reloading mechanisms, or mou
4444
into the local container images to sync code changes. This can be done, but there is no built-in
4545
mechanism for doing so in Wrangler, and best-practices will depend on the languages and frameworks
4646
you are using in your container code.
47+
48+
## Troubleshooting
49+
50+
### Exposing Ports
51+
52+
In production, all of your container's ports will be accessible by your Worker,
53+
so you do not need to specifically expose ports using the [`EXPOSE` instruction](https://docs.docker.com/reference/dockerfile/#expose) in your Dockerfile.
54+
55+
But for local development on non-Linux systems, you most likely need to expose a port to access your container properly; for example: `EXPOSE 4000`.
56+
57+
If you have not exposed any ports, you will see the following type of error when building or pulling your container image:
58+
59+
```text
60+
The container "MyContainer" does not expose any ports, please expose any port that you want to use with `getTCPPort()`.
61+
```
62+
63+
And if you call `getTCPPort()` on an unexposed port you will see the following error:
64+
65+
```text
66+
XXX
67+
```

0 commit comments

Comments
 (0)