- HOW TO RUN MICROSOFT PROJECT ON A MAC HOW TO
- HOW TO RUN MICROSOFT PROJECT ON A MAC INSTALL
- HOW TO RUN MICROSOFT PROJECT ON A MAC CODE
- HOW TO RUN MICROSOFT PROJECT ON A MAC PLUS
- HOW TO RUN MICROSOFT PROJECT ON A MAC WINDOWS
RUN dotnet build "BlazorServerWithDocker.csproj" -c Release -o /app/build RUN dotnet restore "BlazorServerWithDocker.csproj" FROM /dotnet/aspnet:6.0 AS baseįROM /dotnet/sdk:6.0 AS buildĬOPY Below is a version of the dockerfile after a couple of modifications to remove the folder structure assumption. It seems to expect a certain folder structure where the dockerfile is one level higher than the project, if that's not the case then things won't work. After a few seconds you should see a Dockerfile appear in the root of the project.Ī word of warning here - I've found this file doesn't always seem to work properly.
HOW TO RUN MICROSOFT PROJECT ON A MAC WINDOWS
If your application does require something Windows specific then make sure to chose Windows here.
HOW TO RUN MICROSOFT PROJECT ON A MAC PLUS
I'm choosing Linux as I'm on a Mac anyway plus hosting is cheaper when I want to push this to Azure. You will then be asked what target OS you want. If you're using Visual Studio then right click on your project and select Add > Docker Support.
HOW TO RUN MICROSOFT PROJECT ON A MAC CODE
If you're using something other than Visual Studio, such as VS Code then just create a new file in the root of your project called dockerfile with no extension and paste in the code from a bit further down. The first thing we're going to do is create a dockerfile in the root of the project. For the purpose of this post we're going to be using the default project template for a Blazor Server app. Just follow the setup instructions and you will be up and running in a couple of minutes.
HOW TO RUN MICROSOFT PROJECT ON A MAC INSTALL
If you've not done any work with Docker before you will need to install Docker Desktop for Windows or Docker Desktop for Mac. Containerising a Blazor Server App Prerequisites They're started by using the docker run command and specifying the image to use to create the container. You can spin up many containers from a single image. ContainerĪ container is an instance of an image. Images can be stored in an image repository such as Docker Hub or Azure Container Registry - think NuGet but for containers - which allows them to be shared with others. Images are immutable once created, but they can be used as base images in a dockerfile to allow customisation. Images are built up in layers, just like an onion, and each layer can also be cached to help speed up build times. Imageĭocker images are the result of running a dockerfile. Docker images are created by running the docker build command against a dockerfile. You can think of a dockerfile as a blueprint which contains all the commands, in order, needed to create an image of your application. Where a traditional VM would need a few minutes before additional capacity comes online, a container can be started in a few fractions of a second. This makes them exceptionally good at scaling on demand. This allows more containers to be run on the same physical hardware giving containers an advantage over traditional virtual machines.Īs containers only contain what is needed to run the application it makes them extremely quick to spin up. These containers are isolated from one another but run on a shared OS kernel, making them far more lightweight than virtual machines. What is Docker?ĭocker is a platform which provides services and tools to allow the building, sharing and running of containers. All the code for this post is available on GitHub.īefore we get into things, let's cover what Docker is and a few key concepts.
HOW TO RUN MICROSOFT PROJECT ON A MAC HOW TO
We're going to have a look at how to create images and from there how to create containers. In this post, I'm going to show you how to run a Blazor Server application in a container. This image can then be shared and instances of it, known as containers, can then be run. This is achieved by bundling the whole runtime environment - the application, it's dependancies, configuration files, etc. They solve the problem of how to have an application work consistently regardless of the environment it is run on. Part 4 - Deploying Containerised Apps to Azure Web App for ContainersĬontainers are all the rage now-a-days and for good reason. Part 3 - Publishing to Azure Container Registry using Azure Pipelines Part 2 - Containerising a Blazor WebAssembly App Part 1 - Containerising a Blazor Server App (this post) This is the first post in the series: Containerising Blazor Applications With Docker. Containerising Blazor Applications With Docker (Part 1)