Skip to content

Commit b8fd98a

Browse files
gibson042t3chguy
andauthored
Specify a local address when exposing ports with Docker (#20891)
* Specify a local address when exposing ports with Docker cf. https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port--p---expose Signed-off-by: Richard Gibson <[email protected]> * Provide and explain docker run examples with and without confinement to localhost Signed-off-by: Richard Gibson <[email protected]> * Update README.md Co-authored-by: Richard Gibson <[email protected]> --------- Signed-off-by: Richard Gibson <[email protected]> Co-authored-by: Michael Telatynski <[email protected]>
1 parent a27dfa1 commit b8fd98a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/install.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,23 @@ The Docker image can be used to serve element-web as a web server. The easiest w
4141
it is to use the prebuilt image:
4242

4343
```bash
44-
docker run -p 80:80 vectorim/element-web
44+
docker run --rm -p 127.0.0.1:80:80 vectorim/element-web
45+
```
46+
47+
A server can also be made available to clients outside the local host by omitting the
48+
explicit local address as described in
49+
[docker run documentation](https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port--p---expose):
50+
51+
```bash
52+
docker run --rm -p 80:80 vectorim/element-web
4553
```
4654

4755
To supply your own custom `config.json`, map a volume to `/app/config.json`. For example,
4856
if your custom config was located at `/etc/element-web/config.json` then your Docker command
4957
would be:
5058

5159
```bash
52-
docker run -p 80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web
60+
docker run --rm -p 127.0.0.1:80:80 -v /etc/element-web/config.json:/app/config.json vectorim/element-web
5361
```
5462

5563
To build the image yourself:

0 commit comments

Comments
 (0)