Skip to content

Where is IP Address coming from? #232

Answered by mariotoffia
joeutz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @joeutz, you can use a custom endpoint resolver. Just add UseCustomResolver() and provide with your own!

Cheers,
Mario :)

This is a sample to override the default resolver.

using (
  var container =
    Fd.UseContainer()
      .UseImage("postgres:9.6-alpine")
      .WithEnvironment("POSTGRES_PASSWORD=mysecretpassword")
      .ExposePort(5432)
      .UseCustomResolver((
        ports, portAndProto, dockerUri) =>
      {
        if (null == ports || string.IsNullOrEmpty(portAndProto))
          return null;

        if (!ports.TryGetValue(portAndProto, out var endpoints))
          return null;

        if (null == endpoints || endpoints.Length == 0)
          return null;

        if (C…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mariotoffia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants