I have dockerfile like that:
FROM microsoft/aspnetcore-build:2.0 AS build-env WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
COPY *.config ./
RUN dotnet restore --configfile NuGet.config
# Copy everything else and build
COPY . ./ RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENV ASPNETCORE_URLS http://+:5000
ENTRYPOINT ["dotnet", "AuthService.dll"]
我在Gitlab构建中找不到它。
整个Nuget缓存位于build-env
下的~/.nuget/packages
,但Gitlab似乎没有看到它(我想它只检查最后一个容器)。
有什么解决方法吗?由于没有NuGet缓存,构建时间很长...
~/.nuget
和.nuget
,但都失败了。 - Nordes