From the microsoft docs:
Docker support is available for ASP.NET projects, ASP.NET Core projects, and .NET Core and .NET Framework console projects.
I've been trying to put together a docker image that supports a UWP application, but struggling to put the build artificacts in the right locations.
Does anyone know if a windows supported Docker image for UWP is in the works?
Related
I have a Visual Studio Code app (Angular/.Net Core Web Api app) for work and I can develop, debug and run it on my personal Mac when I VPN into my companies network.
I also have a desktop work PC on my companies site and a remote work server that I can RDP into to do all my work, but I prefer my personal Mac!
I now need to create a .Net Web Api app (NON .Net Core) that my .Net Core app needs to call over http (for WCF web services that won't run on .Net Core), so I created a Visual Studio .Net Framework web Api app on one of my Win PC work machines and I can run both projects side by side (Visual Studio Code and Visual Studio) on my PC but not my Mac.
Is there any way to get the .Net Framework app working on my Mac? ex. in a Docker container or maybe even just running the app in a container, so that my .Net Core app can call it?
Another idea I have but not sure if possible -
When I run the .Net Core app on my Mac I'm VPN'd into my companies network. If I run the .Net Web app on my work desktop or the remote server would I be able to connect to it from my Mac?
Visual Studio Code is a JavaScript application, which is what makes it nice a portable (and also kind of slow). The Visual Studio Framework is a different animal; one that is very territorial. Compiled applications that target the .NET framework will absolutely not run on MacOS, or Linux, or Solaris or..... anything not Windows. .NET core is portable to MacOS though.
As per this post (Can you install and run apps built on the .NET framework on a Mac?) there is the option of using Mono to recompile the code and run it on the Mac. Unfortunately, it does not support the full .NET Framework, and likely requires some non-trivial modifications to the code to make it work. If you go this route, you're either going to be limited to the areas of the Framework that are supported by Mono, or you'll have to maintain 2 different versions of the same code base. Neither option sounds very good to me.
As far as running in Docker, that will not work. Docker is fundamentally tied to the host operating system due to the use of kernel namespaces to provide isolation for processes and other system resources. It does not provide the same kernel API that the .NET Framework would require.
If you are absolutely determined to keep the development work on the Mac, the best option is probably to use a thick virtual machine that runs a full copy of Windows. This has the obvious downsides of being much more expensive (both in terms of the system resources it will need, and the software licensing costs), and you end up using Windows anyway (so you might as well just RDP to a real Windows machine). Probably not the answer you were hoping for (and I would love for someone to list some options that I've missed), but I think you're going to end up doing some work in Windows.
You can't run .NET Framework , because this working with layer architecture from operative system, when running, so many libraries is on migration and now running in .NET core via nuget recomendation is use oficial net core image from microsoft or run you docker over a microsoft server system.
I am using this docker image now:
microsoft/dotnet:2.2.2-aspnetcore-runtime-alpine
I want to upgrade to 2.2.7 but can't manage to find correct tag on docker:
This url https://registry.hub.docker.com/v1/repositories/microsoft/dotnet/tags seems to only have 2.2.2 as the latest version.
It seems that Microsoft has moved to their own docker repository (mcr.microsoft.com/dotnet/core/runtime:2.2) while maintaining documentation on docker hub? I am really confused with what is going on in there.
So I really want to find a corresponding image to my original but version 2.2.7 for both aspnet or ordinary runtime (without aspnet)
Have found out with some help from Panagiotis:
Microsoft has moved all their images to own repository, see more information here. They do reference these images from a documentation on docker hub even though the images are not published there.
Docker images that can be used for dotnet core:
mcr.microsoft.com/dotnet/core/runtime-deps:2.2.3 - use for deploying self-contained deployment apps
mcr.microsoft.com/dotnet/core/runtime:2.2.3 - use for deploying .NET Core console apps
mcr.microsoft.com/dotnet/core/aspnet:2.2.3 - use for deploying ASP.NET Core apps
mcr.microsoft.com/dotnet/core/sdk:2.2.105 - use for building .NET Core (or ASP.NET Core apps)
I have several micro services that I would like to dockerized them. Is it better to build them in a self-hosted console application or build asp.net web application?
Which one is faster?
My MicroServices are only simple Web Api.
Just gonna give you my experience on this, not necessarily a 'complete answer':
If you create a .NET Core WEB API in Visual Studio and 'Add Docker support', you can directly deploy them to regular AppServices (specify 'Linux' as the operating system when you CREATE the AppService).
The Visual Studio wizard will automatically setup the container registry for your images, and configure the appservice to deploy whenever there's a new tag for your image.
I've also migrated this same Web API to deploy to a Windows AppService without docker, we didn't need to change any of the code, just deploy it without docker as a regular web app.
Which means if you build this as a .NET CORE 2 Web API you can deploy the same code to either a Linux Appservice using Docker or to a regular Appservice.
If you're planning to use anything different than AppServices tho, you might want to check Container services or Service Fabric, which IIRC is more expensive (would make sense if you need to scale this massively)
I am using VS 2017 15.6.4 which is the latest version. I have a single solution that has three web projects in it:
Solution:
Web Project 1
Web Project 2
Web Project 3
I would like to add Docker support so that all the web projects end up in a single container running IIS with the following IIS site structure:
Root Site (Web Project 1)
Admin Virtual Application (Web Project 2)
Campaign Virtual Application (Web Project 3)
Is there a way to accomplish this in Visual Studio 2017? When I add Docker support it seems to be on a project by project basis. I can run each project in its own container with no issues. Will I be forced to do this outside of Visual Studio?
I had a similar question and found the following helpful. Make sure you have Docker CE installed on your machine, along with VS2017 with Docker support. In VS2017, when you do "Add->Docker Support", it should automatically include the docker-compose.yml file at the root of your solution.
https://learn.microsoft.com/en-us/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/multi-container-applications-docker-compose#step4_define_svcs_in_docker_compose_yml
There is also a sample application posted on github, linked below. Note that this follows .Net Core v2.1. I'm assuming you are using .net core and if so, note that v2.0 is end of life later this year so you should consider moving to v2.1
https://github.com/dotnet-architecture/eShopOnContainers
The github project above also has links to some free books talking more on docker and .net core. They helped me out a lot!
Can I package up a .Net web application (that normally runs on Windows 7 etc) to run in a Docker container, and then execute it on 'any' host supporting Docker?
Such as Dockers on Linux or Dockers on Windows etc?
You can at least use dotnet core image.
From Getting Started with .NET and Docker:
.NET Core is the open-source version of .NET which is available now. It has a different focus from the full .NET and it’s a modular framework, so you only include the parts you need – the framework itself is composed from NuGet packages.
Before you can run .NET Core apps on a Linux (or OS/X, or Windows) machine, you need to install the DNX runtime. This isn’t the full .NET runtime that we have on Windows; it’s a slimmed-down .NET Execution Environment (DNX).
When you define a Docker image, you start from an existing base image, and the sixeyed/coreclr-base image which is publically available on the Hub already has the DNX installed and configured. To containerize your own .NET Core app, just use that base image and add in your own code.