Skip to content

docker pull tricky when supporting .NET Core 3.1 and .NET 5.0 #2334

Closed

Description

@nycdotnet

Describe the Problem

At Namely we've got many .NET Core 3.1 services running in Docker containers with Kubernetes. We've been building our base .NET docker images with a .sh script with lines like this:

docker pull mcr.microsoft.com/dotnet/core/sdk:${DOTNET_VERSION}
docker pull mcr.microsoft.com/dotnet/core/aspnet:${DOTNET_ALPHA_VERSION}

When our developers are testing out the latest .NET version, they can opt-in to the latest Namely container by choosing the alpha label, or they can stay on stable by choosing the latest label.

The problem is now that because .NET 5 is not "Core" anymore, the path in the MCR is different. We had to adapt our build script to do decimal math in bash which is not the greatest. This is the thing we came up with.

# allows you to compare decimal numbers in bash
compare() (IFS=" "
  exec awk "BEGIN{if (!($*)) exit(1)}"
)

if compare "${DOTNET_VERSION} >= 5"; then
  dotnet_container_root_path="dotnet"
else
  dotnet_container_root_path="dotnet/core"
fi

docker pull mcr.microsoft.com/${dotnet_container_root_path}/runtime:${DOTNET_VERSION}

Describe the Solution

Since we have all our services on .NET Core 3.1 today (or .NET 5 RC2) I wonder if there would be any way that this rough edge of the MCR namespace being changed could be smoothed out. Is there any way that the supported .NET Core 3.1 and 2.1 images could be cross posted under the not "core" namespace in MCR? We expect to be on .NET Core 3.1 and 5.0 once it ships for at least a few months, but probably by April 2021 we'll be fully .NET 5.

Activity

  1. MichaelSimons commented on Oct 28, 2020

    @MichaelSimons
    Member

    This is the customer scenario for #2317.

  2. added this to the 5.0 milestone on Oct 28, 2020
  3. mthalman commented on Nov 10, 2020

    @mthalman
    Member

    This issue is now resolved by including all 2.1- and 3.1-related tags in the new repositories. In addition, they are "syndicated" back to the original repositories to ensure backwards compatibility. This means that you can pull a given 2.1/3.1 tag in either the new repository (dotnet) or old repository (dotnet/core) and it will give you the same image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions