部署应用程序时ImageStream metadata.name问题

时间:2019-05-30 05:59:43

标签: docker asp.net-core openshift

我在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 '/'

这有什么问题?还是如何避免呢?

0 个答案:

没有答案