Skip to content

Environment variable hostname not respected in docker (maybe linux in general) #160

@grasdk

Description

@grasdk

With DefaultHostname=%HostName% in webone.conf, the docker container's internal IP addresss is used, rather than the container's hostname.

Started the docker container using argument --hostname mytest
A shell in the container shows that it is respected in the environment

# hostname
mytest

Also tested with a small program built inside the container, which printed the hostname mytest

using System;

class Program
{
    static void Main()
    {
        Console.WriteLine($"Machine Name: {Environment.MachineName}");
    }
}

Webone is running, but the proxy is using the container's internal IP rather than the hostname provided. You can see this when looking in the network tab of your browser:
image

Also the default page shows similar problems:
image

The problem might be in lines 218-226 in ConfigFileLoader, probably in line 220, though I can't see how.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions