windows icon indicating copy to clipboard operation
windows copied to clipboard

[Question]: Expose a running application to my host machine through some port

Open YayL opened this issue 1 year ago • 2 comments

Operating system

Windows 11 23H2

Description

I am currently using the docker container to run a piece of software with a web portal. I would, if possible, like to be able to access this portal outside of the container machine. I have tried exposing the port simply using the -p argument when running the container as well as disabling the firewall but I have yet to manage the task. I might lack some sort of fundamental knowledge required for this but I'd like some assistance as this seems like something that should be possible.

The application is running on port 80 and 443 as it supports HTTP and HTTPS and I need to access the path /index.html. When I've tried so far it hangs indefinitely and sometimes chooses to resolve but saying that it was unable to connect.

Thank you.

Docker compose

services:
  windows:
    image: dockurr/windows
    container_name: windows
    environment:
      VERSION: "win11"
      KEYBOARD: "sv-SE"
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 443
      - 3389:3389/tcp
      - 3389:3389/udp
    volumes:
      - ./oem:/oem
    stop_grace_period: 2m

Docker log

no

Screenshots (optional)

No response

YayL avatar Jul 02 '24 11:07 YayL

This issue is similar to 512

And to answer the question asked in that issue. I have tried turning off the firewall within the container to no avail.

YayL avatar Jul 05 '24 06:07 YayL

+1. Just doesn't seem to work, firewall completely disabled, even attempted following both this and this to make Windows part of my home network just like a regular PC.

Umbranoxio avatar Jul 12 '24 20:07 Umbranoxio

This should be no problem. If it doesnt work, please post the log of the startup so we can make sure the container does not fallback to usermode networking (in which case ports need to be forwarded by adding them to USER_PORTS).

Another way would be to add the container to a macvlan network, so it has its own IP and doesnt need port forwarding.

kroese avatar Oct 05 '24 11:10 kroese