<p>Created a new ASP.NET Core 2.0 project and it runs fine locally. 
Then after running it in a Docker container locally it also works fine. But when I try to use the Docker image in a Kubernetes pod, it will run for a couple minutes and then give me this:</p>

<pre><code>    Unhandled Exception: System.InvalidOperationException: A path base can 
    only be configured using IApplicationBuilder.UsePathBase().
    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.
    &lt;BindAddressAsync&gt;d__7.MoveNext()
</code></pre>

<p>Here is my <code>Program.cs</code>:</p>

<pre><code>public class Program
{
    public static void Main(string[] args)
    {
         BuildWebHost(args).Run();
    }

    public static IWebHost BuildWebHost(string[] args) =&gt;
         WebHost.CreateDefaultBuilder(args)
             .UseStartup&lt;Startup&gt;()
             .Build();
}
</code></pre>

<p><code>Startup.cs</code>:</p>

<pre><code>public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
            app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
            {
                HotModuleReplacement = true,
                ReactHotModuleReplacement = true
            });
        }
        else
        {
            app.UseExceptionHandler("/Home/Error");
        }

        app.UseStaticFiles();

        app.UseMvc(routes =&gt;
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");

            routes.MapSpaFallbackRoute(
                name: "spa-fallback",
                defaults: new { controller = "Home", action = "Index" });
        });
    }
}
</code></pre>

<p>When this error was happening, we were using the <code>FROM microsoft/aspnetcore-build:1.1</code> base image as our build and runtime.  At the time we were encountering the error, we had simply tried to upgrade to <code>FROM microsoft/aspnetcore-build:2.0</code>.  I'm not certain what specifically the issue with this image was, but Kubernetes didn't like it.</p>

<p>At a later date, we switched the dockerfile to multistage; building with <code>FROM microsoft/aspnetcore-build:1.1</code> and running with <code>FROM microsoft/dotnet:1.1-runtime</code>, and when we upgraded that to the corresponding 2.0 versions, we didn't encounter this error again.</p>
