1
votes

I want to create a docker image for my Asp.net Core application. The environment is CentOS7.5, and dotnet-sdk-2.1.500. Here is the full error message when I enter the command.

docker build -t wechat .: Sending build context to Docker daemon 1.547 MB Step 1/17 : FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base Error parsing reference: "microsoft/dotnet:2.1-aspnetcore-runtime AS base" is not a valid repository/tag: invalid reference format

Sending build context to Docker daemon 1.547 MB Step 1/17 : FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base Error parsing reference: "microsoft/dotnet:2.1-aspnetcore-runtime AS base" is not a valid repository/tag: invalid reference format

I wonder is there any setup I did wrong? How can I get through it?

1
Could you please share your Dockerfile and the command you're using to create the docker image?Prafull Ladha
Thanks for helping. I think it's because of the version of docekr, After I tried to upgrade the docker 1.13 to docker-ce 18 suggested by the answer below,I solved my problem.Frank Kane

1 Answers

2
votes

For invalid reference format, it is usually caused by the wrong docker version.

For FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base, it uses the docker new feature named multi-stage builds which requires Docker 17.05 or higher.

Try to follow Get Docker CE for CentOS to reinstall or upgrade your docker ce.