Give an example of PORT in readme?
mccalluc opened this issue · comments
Thanks for making this! This might be obvious, but I was confused at first when PORT
by itself didn't work for me, but adding --publish
fixed it. Maybe an example in the README of the correct usage?
$ docker run --detach -P -e PORT=80 --name echo1 jmalloc/echo-server
$ docker logs echo1
Echo server listening on port 80.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
40d0d62870b4 jmalloc/echo-server "/bin/echo-server" 30 seconds ago Up 29 seconds 0.0.0.0:32995->8080/tcp echo1
$ curl http://localhost:32995
curl: (52) Empty reply from server
$ docker run --detach --publish 11111:80 -e PORT=80 --name echo2 jmalloc/echo-server
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
114811d87923 jmalloc/echo-server "/bin/echo-server" 7 seconds ago Up 7 seconds 8080/tcp, 0.0.0.0:11111->80/tcp echo2
40d0d62870b4 jmalloc/echo-server "/bin/echo-server" About a minute ago Up About a minute 0.0.0.0:32995->8080/tcp echo1
$ curl http://localhost:11111
Request served by 114811d87923
HTTP/1.1 GET /
Host: localhost:11111
User-Agent: curl/7.52.1
Accept: */*
Apologies for my remarkably late reply. I finally got around to updating the README to demonstrate this more directly. Thanks for the report :)