Сбой сборки Docker на конвейере Azure из-за COPY --from = build - PullRequest
0 голосов
/ 24 сентября 2019

Привет, ребята, у меня проблемы с получением COPY --from = build / src / dest в конвейере Azure.Хотя он работает на моем локальном компьютере ... см. Код ниже

Dockerfile

#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat 

FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2-windowsservercore-ltsc2019 AS build
WORKDIR /src

COPY . .
COPY SimpleWeb/*.csproj ./SimpleWeb/
COPY SimpleWeb/*.config ./SimpleWeb/
RUN nuget restore

COPY SimpleWeb/. ./SimpleWeb/
WORKDIR /src/SimpleWeb
RUN msbuild /p:Configuration=Release

FROM mcr.microsoft.com/dotnet/framework/aspnet:4.7.2-windowsservercore-ltsc2019 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /src/SimpleWeb/bin/Release/Publish/. .

Azure Pipeline.yml

# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'windows-latest'

steps:
- task: Docker@2
  displayName: Build
  inputs:
    containerRegistry: 'container-registry-dockerhub'
    repository: 'myrepo'
    command: 'build'
    Dockerfile: '**/Dockerfile'
    tags: 'latest'
- task: Docker@2
  displayName: Push
  inputs:
    containerRegistry: 'container-registry-dockerhub'
    repository: 'myrepo'
    command: 'push'
    tags: 'latest'

ОШИБКА из сборки Azure CI

Step 12/21 : COPY --from=build /src/SimpleWeb/bin/Release/Publish/. .
COPY failed: CreateFile \\?\Volume{a4952e14-500f-4d78-9efe-1a9e638e3459}\src\SimpleWeb\bin\Release\Publish: The system cannot find the path specified.
##[error]The process 'C:\Program Files\Docker\docker.exe' failed with exit code 1

------ EDITED ------ это работает, хотя:

COPY --from = build / src / SimpleWeb /..

Я не уверен, почему bin / Release / Publish не генерируется в конвейере Azure

...