Docker container to connect to Postgres not in docker

后端 未结 2 1896
温柔的废话
温柔的废话 2021-01-26 15:40

I have a .NET application running on a windows 10 computer using docker and postgres. When I run using the

 "DockerTest": {
      "commandName"         


        
2条回答
  •  伪装坚强ぢ
    2021-01-26 16:20

    Have you tried with hos ip as your PostgreSQL host. I have just tested with asp.net core 3.1 and PostgreSQL both in windows 10 docker Linux separate container.

    Its running without issue.

    my connection string is

    optionsBuilder.UseNpgsql("HOST=192.168.1.100;DataBase=TestIdentity;UserName=postgres;Password=*****;");

提交回复
热议问题