Docker error with .Net 6 runtime image

December 04, 2021

While trying to set-up a docker image for a .Net 6 console application, I found that, although it built fine, I got the an error when trying to run it. Let’s imagine that I used the following commands to build and run:

docker build -t pcm-exe
docker run pcm-exe

The result from the run command was the following:

It was not possible to find any compatible framework version The framework ‘Microsoft.NETCore.App’, version ‘6.0.0’ (x64) was not found.

  • The following frameworks were found: 6.0.0-rc.2.21480.5 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

This had me stumped for a while, as I was under the impression that when images are updated, docker knows to go and download them - this is not the case. I discovered this by running an inspect on the runtime image from the dockerfile defined here:

FROM AS base

The inspect command:

docker inspect

This gave the following result:

    "Env": [

At this point there seemed to be two options - you can just remove the image - that would force a re-download; however, a quicker way is to pull the new version of the image:

docker pull 

After rebuilding the image, running a subsequent inspect shows that we’re now on the correct version:

          "Env": [

Profile picture

A blog about one man's journey through code… and some pictures of the Peak District

© Paul Michaels 2024