Docker Community Forums

Share and learn in the Docker community.

Condition to setup Window OS Server to run .NET Core Container

Hi I done my first .NET Core WebApp in local development machine laptop, and successfully build docker file, image & container and run on local machine .NET Core IDE. My WebApp required to connect to third party API as well which is hosted in other Server 2, and is successfully tested in my local laptop.

Now I having another new clean Server 3, installed in Window 10:-

  1. As I know I need to install Docker Window in Server 3, what else i required to install to ready the server to run my container?

  2. If the network connection granted between Server 2 & Server 3, my WebApp Container
    will able connect to third party API hosted in Server 2 too?

  3. Assuming 1. & 2. is ready, understood that one of the option to deploy my container is upload to docker hub, and I can pull the container in Server 3. But is there any way to deploy my container without using docker hub?

  4. For item 3., meaning to say can i have alternate way to deploy my WebApp Container
    from my laptop to Server 3. For example copy file or etc?

Can kindly help on this thanks.

This is done using this Yeoman generator:

yo docker

Pick .NET Core as the project type, ‘rtm’ as the version, then the defaults for the rest and a name of your choice (preferably something short).

This will result in some bootstrapping scripts and config files, and two Dockerfiles – one for development and one for production. Each are based on one of three image types which encapsulate a bare Debian image plus some or all of the .NET Core dependencies, optimized for various scenarios. Here’s the gist of each:

E.G 1.0.0-preview2-sdk – contains the full Core SDK and CLI tools. Used for development/debugging/unit testing, and can also be run in build environments. This one’s larger in size (~500 MB), but Docker’s image layering results in this not being duplicated (i.e it’s efficient) for multiple containers.

E.G 1.0.0-preview2-onbuild – optimized for build environments. This is based of the above ‘sdk’ version, and adds copying of your app code, runs dotnet restore and has an ENTRYPOINT command to start your web server when the container is run.

This one just contains the OS plus the native .NET Core dependencies, and is thus the smallest (160 MB). There’s also a ‘-core’ version which is designed to take the output of dotnet publish (for portable .NET Core applications). Either of these are optimized for use in production only.

Update: as per official guidance, the optimal base image for ASP.NET Core 1.0 apps is microsoft/aspnetcore. This includes dependencies out of the box and removes an unnecessary package restore as was the case with using the onbuild base image in the original version of this post. For .NET Core-only apps it is advised to use the core or core-deps image.

Thanks very much, i will study on it.
Any links you know? That will provide some steps