我在ASP.NET Core 2.2上具有微服务。 像这样的Dockerfile:
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY ["DBPatchDeployService/DBPatchDeployService.csproj", "DBPatchDeployService/"]
RUN dotnet restore "DBPatchDeployService/DBPatchDeployService.csproj"
COPY . .
WORKDIR "/src/DBPatchDeployService"
RUN dotnet build "DBPatchDeployService.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "DBPatchDeployService.csproj" -c Release -o /app
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "DBPatchDeployService.dll"]
此dockerfile由VS 2019生成。在本地docker上运行良好。但是当我尝试制作OpenShift应用
oc new-app . --strategy=docker --source-secret=gitlab --name=lk-db-patch-service
我收到错误消息:
error: ImageStream "core/aspnet" is invalid: metadata.name: Invalid value: "core/aspnet": may not contain '/'
这有什么问题?还是如何避免呢?