Deploying .NET Core web application using docker container on Azure

Photo by frank mckenna on Unsplash
FROM microsoft/dotnet:2.1-aspnetcore-runtime AS baseCOPY bin/Release/netcoreapp2.1/publish/ app/ENTRYPOINT ["dotnet", "app/WebApplication2.dll"]
Command : docker build –t dockerusername/imagename.
Sending build context to Docker daemon  16.57MBStep 1/3 : FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base---> b3df7864b3e1Step 2/3 : COPY bin/Release/netcoreapp2.1/publish/ app/---> Using cache---> c97323bac0a4Step 3/3 : ENTRYPOINT ["dotnet", "app/WebApplication1.dll"]---> Using cache---> bbbdfdce8541Successfully built bbbdfdce8541Successfully tagged vaibhavrb/webapplication:latestSECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
Command: docker container run --name <container name> -p <port used in local machine>:<port running in container> <image name>
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]User profile is available. Using '/root/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[58]Creating key {d1bb5f67-71c4-4db0-8f34-8e5d00080f7b} with creation date 2019-12-09 12:25:59Z, activation date 2019-12-09 12:25:59Z, and expiration date 2020-03-08 12:25:59Z.warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]No XML encryptor configured. Key {d1bb5f67-71c4-4db0-8f34-8e5d00080f7b} may be persisted to storage in unencrypted form.info: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[39]Writing data to file '/root/.aspnet/DataProtection-Keys/key-d1bb5f67-71c4-4db0-8f34-8e5d00080f7b.xml'.Hosting environment: ProductionContent root path: /Now listening on: http://[::]:80Application started. Press Ctrl+C to shut down.
Command: docker push <docker username>/<image name>
The push refers to repository [docker.io/ dockerusername /webapplication]c3b400f3a2be: Mounted from dockerusername/webapp3c5b129061374: Mounted from dockerusername/webapp3a2f9ed91e120: Mounted from dockerusername/webapp375bb365bb264: Mounted from dockerusername/webapp399b5261d397c: Mounted from dockerusername/webapp3latest: digest: sha256:70fd9e4004234ad32c2d73a009392a77996d754607416fbab7e9c421f2b2d1db size: 1374

--

--

--

Technical Speaker | Computer Engineer | Full Stack Web Developer | ML Enthusiast | * Knowledge Shared = Knowledge² *

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Unit Testing is not sufficient testing

Blog #10 — Oct. 31

SVN Commands in Linux — Narayana Tutorial

#100DaysofAWS | Day 34 | AWS Storage Gateway

Elixir: Ecto — find records on empty associations

Install appium on Mac for real device iOS automation (GUI & Command line tools)

Introducing Jovo Framework v2

Ubiquiti EdgeOS Terraform Provider

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vaibhav Bhapkar

Vaibhav Bhapkar

Technical Speaker | Computer Engineer | Full Stack Web Developer | ML Enthusiast | * Knowledge Shared = Knowledge² *

More from Medium

Use of Environment Variable inside Azure Function in C#

How to use Replace Tokens in Azure Pipelines

Creating an Azure SQL Database, with .Net6 Rest API

Azure Load Balancer Health Probe: Poll HTML page for Web API health