更新时间:2023-10-20 12:12:34
我发现以下帖子非常有用:如何从主机外部连接到docker容器(相同的网络)[Windows] 。遵循以下步骤可以很好地工作:
I found the following post that was really helpful: How to connect to a docker container from outside the host (same network) [Windows]. Following the steps below worked perfectly:
您现在应该可以通过localhost:8080和your-internal-ip:8080浏览到您的容器。
You should now be able to browse to your container via localhost:8080 and your-internal-ip:8080.
启动容器(Dockerfile EXPOSES 5000):
docker run -p 8080:5000 -it jwarren:project
Started up the container (Dockerfile EXPOSES 5000): docker run -p 8080:5000 -it jwarren:project