-
Notifications
You must be signed in to change notification settings - Fork 168
Conversation
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 |
There was a problem hiding this comment.
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
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. |
@glennc 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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
- explicit use of
UseUrls
: Change templates to use environment variable for urls. aspnet/Templates#574 (comment) - explicit use of 'hosting.json`: https://github.com/peterblazejewicz/recipes/blob/master/src/gulp-dotnet-browser-sync/StarterWeb/Program.cs#L12-L13
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/
There was a problem hiding this comment.
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.
Fixes #685.
/cc
@OmniSharp/generator-aspnet-team-push