eShop icon indicating copy to clipboard operation
eShop copied to clipboard

Standalone Remote Docker issue

Open devizer opened this issue 2 months ago • 0 comments

The built-in feature of the Docker client is the ability to interact with remote Docker using DOCKER_HOST

But src\eShop.AppHost\Program.cs configures services to listen only 127.0.0.1

As a result, aspire successfully downloads images and starts containers on remote docker by dotnet run:

PS M:\eShop-SQL-Server\eShop\src\eShop.AppHost> docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS          PORTS                                                                       NAMES
d1e9fb71112a   ankane/pgvector:latest   "docker-entrypoint.s…"   31 seconds ago   Up 30 seconds   127.0.0.1:49158->5432/tcp                                                   postgres-fjctrgzs
526dee5fdf04   rabbitmq:3.13            "docker-entrypoint.s…"   31 seconds ago   Up 31 seconds   4369/tcp, 5671/tcp, 15691-15692/tcp, 25672/tcp, 127.0.0.1:49157->5672/tcp   eventbus-wkgvgadv
a5aabf8828b7   redis:7.4                "docker-entrypoint.s…"   31 seconds ago   Up 31 seconds   127.0.0.1:49156->6379/tcp                                                   redis-tarxxvkr
PS M:\eShop-SQL-Server\eShop\src\eShop.AppHost>

But they listen only 127.0.0.1 on the docker host. As result, any comunication from eShop application is refuced

Method .WithHostPort(12345, isExternal: true) may solve the problem, but the port should be hardcoded and is not available in 8.0 version

  1. Is there workaround for 8.0?
  2. Is there a solution for 10.0 without a hardcoded port?

devizer avatar Oct 19 '25 14:10 devizer