1

Does anyone know how to get an AspNetCore 3.0 image for free my minishift project. Thank you in advance.

1 Answers1

0

I am not sure if I understood your question correctly, but Microsofts ASP.NET Core Runtime container image is available here: https://hub.docker.com/_/microsoft-dotnet-core-aspnet/

docker pull mcr.microsoft.com/dotnet/core/aspnet:3.1

Getting the image to run on OpenShift is a bit tricky, as the container image uses Port 80. So to deploy the sample application, we need to add the extra steps to create a ServiceAccount and assign the SCC:

# Deploy the DeploymentConfig
oc new-app --name aspnetcore-sample mcr.microsoft.com/dotnet/core/samples:aspnetapp

# Create a ServiceAccount, give it the "anyuid" SCC and assign it to the DeploymentConfig
oc create serviceaccount aspnetcore-sample-sa
oc adm policy add-scc-to-user anyuid -z aspnetcore-sample-sa
oc set serviceaccount dc aspnetcore-sample aspnetcore-sample-sa

# Expose the application to the outside world via a route
oc expose dc aspnetcore-sample --port=80
oc expose service aspnetcore-sample

# See the route with the following command
oc get route
Simon
  • 4,251
  • 2
  • 24
  • 34