Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.

Update docker file template for core #724

Closed
wants to merge 3 commits into from
Closed

Update docker file template for core #724

wants to merge 3 commits into from

Conversation

spboyer
Copy link
Contributor

@spboyer spboyer commented May 16, 2016

Fixes #685.

/cc
@OmniSharp/generator-aspnet-team-push

RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
#Set urls and port environments
ENV ASPNETCORE_URLS="http://*:5000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you are missing a " after 5000

@glennc
Copy link
Contributor

glennc commented May 17, 2016

microsoft/dotnet and microsoft/dotnet:core are both coreclr based. The difference is that one only has core dependencies installed, the other has the full SDK. There is no full .NET Docker base that we ship now. There is a preview one for Windows, but no Linux one. For a Mono app (which is what !coreclr would be on Linux) we probably should look at the existing Mono image. But I haven't actually run an app on it yet.

@peterblazejewicz
Copy link
Member

@glennc Thanks!
@spboyer See my PR: https://github.com/OmniSharp/generator-aspnet/pull/715/files
I've unified subgenerator according to new CoreCRL
Thanks!

RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list
RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
#Set urls and port environments
ENV ASPNETCORE_URLS="http://*:5000"
Copy link

@DavidRouyer DavidRouyer May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENV ASPNETCORE_SERVER.URLS instead of ENV ASPNETCORE_URLS?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidRouyer
I think the variable is correct, they key is "ASPNETCORE_{VALUE}":
https://github.com/aspnet/Hosting/blob/dev/src/Microsoft.AspNetCore.Hosting.Abstractions/WebHostDefaults.cs
The ASPNETCORE_URLS is not documented, but its full support is coming: aspnet/Hosting@e7b8c3f

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peterblazejewicz Alright, this is post-RC2 stuff then! For RC2, "ASPNETCORE_URLS" doesn't work.

Copy link
Member

@peterblazejewicz peterblazejewicz May 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically no templates are able to use ASPNETCORE_URLS AFAIK. I've hit that problem previously:

The -p option is supported in dotnet-cli but --server-urls support needs to be determined
#715

The solution is to modify web application startup either by:

The first blog post about RC2 + Docker also has to use that implementation: http://laurentkempe.com/2016/05/16/ASP-NET-Core-RC2-Docker-and-HipChat-Connect-add-on/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current templates are missing the configuration part with environment variables.
For RC2, I added :
var config = new ConfigurationBuilder().AddEnvironmentVariables("ASPNETCORE_").Build(); and .UseConfiguration(config) in Program.cs, and ENV ASPNETCORE_SERVER.URLS="http://*:5000" in my Dockerfile and it works just fine! Looks like I'll have to use ENV ASPNETCORE_URLS="http://*:5000" post-RC2.

@peterblazejewicz
Copy link
Member

@spboyer Shayne, closing in favour of #743
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants