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

ASP.NET 5 Docker image based on CoreCLR #83

Closed
vlesierse opened this issue Sep 3, 2015 · 21 comments
Closed

ASP.NET 5 Docker image based on CoreCLR #83

vlesierse opened this issue Sep 3, 2015 · 21 comments

Comments

@vlesierse
Copy link
Contributor

Now that ASP.NET 5 Beta 7 has support for CoreCLR and that the current Docker images are based on the Mono image, I propose to have two sets of images, one based on Mono and the other on .NET CoreCLR.

There are two possible options which I would like to propose:

Use the image name

docker pull microsoft/aspnet-mono:1.0.0-beta7
docker pull microsoft/aspnet-coreclr:1.0.0-beta7

Use the image tag

docker pull microsoft/aspnet:1.0.0-beta7-mono
docker pull microsoft/aspnet:1.0.0-beta7-coreclr

For both options you could still create a docker pull microsoft/aspnet:1.0.0-beta7 which either points to the mono or the coreclr.

My preference goes to the second option which give you more freedom in aliasing images. For example microsoft/aspnet:coreclr is the same as microsoft/aspnet:latest-coreclr

I can create the CoreCLR version at the earliest next week. If someone didn't send a pull request yet I'll give it a try.

@jchannon
Copy link
Contributor

jchannon commented Sep 3, 2015

Sounds good, I just came to question CoreCLR docker images as part of #78 so I will close that and we can continue here

@vlesierse vlesierse changed the title PROPOSAL: ASP.NET 5 Docker image based on CoreCLR ASP.NET 5 Docker image based on CoreCLR Sep 3, 2015
@jchannon
Copy link
Contributor

jchannon commented Sep 3, 2015

@glennc over to you 😄

@glennc
Copy link
Member

glennc commented Sep 3, 2015

Thanks :). I will add it to the list. Should be mostly the same as the mono Dockerfile

@jchannon
Copy link
Contributor

jchannon commented Sep 3, 2015

cool, let us know when we can get our grubby mits on it or I guess if you want @vlesierse to do anything

@ahmetb
Copy link
Contributor

ahmetb commented Sep 3, 2015

@vlesierse Thanks for bringing this up.

Going forward, there's probably not much value in keeping mono images in this repository*. My opinion is to retire and remove them over time. In the time being, we can keep mono ones as is and keep the coreclr-1.0.0-betaN convention going. I'm +1 for coreclr-latest tag as well.

However in the long run, I am guessing people can switch from mono to coreclr images without changing anything on their applications' Dockerfile. Therefore at some point we'll probably introduce a breaking case (we reserve right to do so as this is just a preview image) and switch everything to coreclr.

PRs welcome for CoreCLR images and let's see if it actually works with Docker! :)

*: community still can maintain those in a separate repo

@vlesierse
Copy link
Contributor Author

Probably in the coming week I can submit a PR, but if someone have time earlier, be my guest. It should be straight forward.

@ahmetb
Copy link
Contributor

ahmetb commented Sep 3, 2015

@vlesierse tried to take a stab at this, looks more complicated than I expected :P

@jchannon
Copy link
Contributor

jchannon commented Sep 3, 2015

Added PR 😄

@akoeplinger
Copy link

@ahmetalpbalkan I'd argue there's definitely value in keeping the Mono images in this repo (even after 1.0), there'll be a long tail of people that aren't able to switch to .NET Core due to dependencies missing etc. I don't envision them being much different from the CoreCLR-based dockerfiles anyway, so it's not a huge maintenance burden.

@jchannon
Copy link
Contributor

jchannon commented Sep 3, 2015

@akoeplinger +1

@ahmetb
Copy link
Contributor

ahmetb commented Sep 3, 2015

OK, let's keep them then. You guys are experts on this more than I am. :-)

@vlesierse
Copy link
Contributor Author

I agree to keep a mono version for a while. A good argument for this is that in the beginning not all libraries are ready to be used with CoreCLR and need to be ported first. Then Mono is your only option.

The conventions of putting the technology first coreclr-1.0.0-beta7 makes sense.

I assume that the Docker on Windows images will have distinctions as well (Full .NET vs CoreCLR) but let's postpone this until there are more details how this will look like.

@jstclair
Copy link

jstclair commented Sep 7, 2015

Not sure if I should file this here, create a new issue, or put in on the DNX repo...

I've had a similar project for hosting a standalone (published) project for a while. In attempting to slim down my images, it's been a lot of back-and-forth to figure out what's really required in the base docker image. You can see my base image here: https://hub.docker.com/r/jstclair/jessie-libuv/~/dockerfile/
and the associated aspnet-docker project here: https://github.com/miles-no/aspnet-docker . In the latter I document the images sizes.

The issue is that I think someone should be responsible for documenting the exact requirements for running DNX on a Linux box. The current images install (but don't remove) a bunch of build tools, and some parts need to be on the machine in order for DNX to run. In jessie-libuv Dockerfile, I've discovered at least GLIBC 2.14, libunwind8, and libc-dev.

I know this isn't exactly what you're trying to do here, but for others trying to create their own base image, it would be useful.

@jstclair
Copy link

jstclair commented Sep 9, 2015

Just a note to the previous comment - I've found the linux required package list (http://docs.asp.net/en/latest/getting-started/installing-on-linux.html#install-the-net-execution-environment-dnx) and am trying that out. Previously, I was getting an error that suggested I needed to install libc-dev.

@jstclair
Copy link

jstclair commented Sep 9, 2015

So, after adding the packages above to my base image, I get the following stack trace when running kestrel:

System.DllNotFoundException: Unable to load DLL 'libdl': The specified module could not be found.
 (Exception from HRESULT: 0x8007007E)
   at Microsoft.AspNet.Server.Kestrel.Networking.PlatformApis.LinuxApis.dlopen(String fileName, Int32 flags)
   at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Load(String dllToLoad)
   at Microsoft.AspNet.Server.Kestrel.ServerFactory.Start(IServerInformation serverInformation, Func`2 application)
   at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start()
   at Microsoft.AspNet.Hosting.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
   at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
   at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)

Doing a search for debian libdl takes me to the following:
https://packages.debian.org/search?suite=stable&section=all&arch=any&searchon=contents&keywords=libdl.so

@ahmetb
Copy link
Contributor

ahmetb commented Sep 9, 2015

@jstclair are you aware of #84?

@jstclair
Copy link

jstclair commented Sep 9, 2015

@ahmetalpbalkan Yes, that's where I saw the link to the required Linux packages. Although that Dockerfile is closer to mine, I just wanted to create a base image with only dependencies but no DNX (I rather publish DNX as part of deploying my application).

@jstclair
Copy link

jstclair commented Sep 9, 2015

Just to close this up - have added the runtime dependencies from the ASPNET documentation (with the addition of libc-dev and everything runs. See jstclair/jessie-libuv@9fe27d7#diff-3254677a7917c6c01f55212f86c57fbf for details

@glennc
Copy link
Member

glennc commented Nov 20, 2015

I think we can close this one now right?

@ahmetb
Copy link
Contributor

ahmetb commented Nov 20, 2015

👍

@vlesierse
Copy link
Contributor Author

Yeah, we can close this issue

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

No branches or pull requests

6 participants