This repository was archived by the owner on Feb 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
Update docker file template for core #724
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<% if(!coreclr){ %>FROM microsoft/aspnet:1.0.0-rc1-update1<% } %><% if(coreclr){ %>FROM microsoft/aspnet:1.0.0-rc1-update1-coreclr<% } %> | ||
<% if(!coreclr){ %>FROM microsoft/dotnet<% } %><% if(coreclr){ %>FROM microsoft/dotnet:core<% } %> | ||
|
||
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" | ||
ENV ASPNETCORE_ENVIRONMENT="Development" | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
RUN ["dnu", "restore"] | ||
RUN ["dotnet", "restore"] | ||
|
||
EXPOSE 5000/tcp | ||
ENTRYPOINT ["dnx", "-p", "project.json", "Microsoft.AspNet.Server.Kestrel", "--server.urls", "http://0.0.0.0:5000"] | ||
EXPOSE 5000 | ||
ENTRYPOINT ["dotnet", "run"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
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 solution is to modify web application startup either by:
UseUrls
: Change templates to use environment variable for urls. aspnet/Templates#574 (comment)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, andENV ASPNETCORE_SERVER.URLS="http://*:5000"
in my Dockerfile and it works just fine! Looks like I'll have to useENV ASPNETCORE_URLS="http://*:5000"
post-RC2.