none
Isolated Container on Host RRS feed

  • Question

  • Hello all,

    I just create a container with an IIS (DotNetNuke) and other container with SQL Database.

    Anyone knows what is the best approach to automatize the creation of both containers, since the connection strings are hardcoded?

    I cant use the name because this host will have several containers with the same image of IIS and SQL.


    Best regards,

    Wednesday, April 4, 2018 5:47 PM

Answers

  • Routing mesh is supported starting with Windows Server 1709. You can always instead publish port on host instead but you will be limited to single container per host this way.
    • Marked as answer by llongshot00 Sunday, April 8, 2018 8:24 PM
    Sunday, April 8, 2018 5:34 PM

All replies

  • What do you mean "automatize creation of both containers"?
    Wednesday, April 4, 2018 6:54 PM
  • I got two containers.

    One with the IIS and other one with SQL

    I need to find a way to when i launch the container of the IIS, the connection string will have the IP of the SQL Database, without to change it manually on the files.


    PS: This is on the following post of the creation of an ASP.NET with windows authentication :)
    • Edited by llongshot00 Wednesday, April 4, 2018 7:09 PM
    Wednesday, April 4, 2018 7:08 PM
  • You create compose file for both IIS and SQL and use SQL by name inside compose file, so when service is started your IIS will connect to SQL by name
    Wednesday, April 4, 2018 7:13 PM
  • Right now im still reading about docker compose, swarm and so on...

    It´s possible to make the name dynamic?

    Because if I want to start another two containers simultaneously it will get the same name of the first container of SQL.

    Wednesday, April 4, 2018 7:27 PM
  • The names are unique within the service, so you can have several services with different names but names of SQL/IIS inside those services will be the same.
    Wednesday, April 4, 2018 7:30 PM
  • Just to confirm if i understand...

    If I create a compose file for instance:

    version: 2.1

    services:

      DB: SQLDB

      SITE: IISWEB

    when i start the service, both of containers will be created with that unique names, but from the Host it´s just 1 ?

    Sorry for the dumb questions...


    • Edited by llongshot00 Wednesday, April 4, 2018 7:36 PM
    Wednesday, April 4, 2018 7:35 PM
  • Hostnames inside containers will be unique but they will be able to resolve the names with just specifying name of service. So when you go into container you will be able to resolve the name DB or SITE
    Wednesday, April 4, 2018 7:39 PM
  • Ok. I tested and it worked on my machine.

    But unfortunately on my environment (server 2016) it not worked 100% because of the route mesh is not supported on overlay.

    It seems the alternative is to publish on transparent network

    Sunday, April 8, 2018 4:58 PM
  • Routing mesh is supported starting with Windows Server 1709. You can always instead publish port on host instead but you will be limited to single container per host this way.
    • Marked as answer by llongshot00 Sunday, April 8, 2018 8:24 PM
    Sunday, April 8, 2018 5:34 PM