【发布时间】:2021-10-23 08:53:56
【问题描述】:
我有一个 azure 管道,现在我已经添加了一个 Visual Studio 步骤。在此之前,管道可以使用 Ubuntu-20.04 作为代理完成。现在我想将 selenium 测试作为管道的一部分运行 ->
然后我添加了 VS 步骤以在部署代码之前运行 Selenium 测试 ->
我将代理设置为 vs2017-win2016 但每次运行时都会收到此错误 ->
Starting: Spice buildAndPush
==============================================================================
Task : Docker
Description : Build or push Docker images, login or logout, start or stop containers, or run a Docker command
Version : 2.192.0
Author : Microsoft Corporation
Help : https://aka.ms/azpipes-docker-tsg
==============================================================================
"C:\Program Files\Docker\docker.exe" pull mcr.microsoft.com/dotnet/aspnet:3.1
3.1: Pulling from dotnet/aspnet
no matching manifest for windows/amd64 10.0.14393 in the manifest list entries
"C:\Program Files\Docker\docker.exe" inspect mcr.microsoft.com/dotnet/aspnet:3.1
Error: No such object: mcr.microsoft.com/dotnet/aspnet:3.1
[]
"C:\Program Files\Docker\docker.exe" build -f D:\a\1\s\spicetheworld\Dockerfile --label com.azure.dev.image.system.teamfoundationcollectionuri=https://dev.azure.com/kevsbox/ --label com.azure.dev.image.system.teamproject=spicetheworld --label com.azure.dev.image.build.repository.name=spicetheworld --label com.azure.dev.image.build.sourceversion=fa0c5f9183c04296b6c1a33acbcc312cc2ffae50 --label com.azure.dev.image.build.repository.uri=https://kevsbox@dev.azure.com/kevsbox/spicetheworld/_git/spicetheworld --label com.azure.dev.image.build.sourcebranchname=development --label com.azure.dev.image.build.definitionname=SpiceThis --label com.azure.dev.image.build.buildnumber=20211022.8 --label com.azure.dev.image.build.builduri=vstfs:///Build/Build/201 --label image.base.ref.name=mcr.microsoft.com/dotnet/aspnet:3.1 -t ***/spicedevrepository:latest D:\a\1\s\spicetheworld
Sending build context to Docker daemon 12.9MB
Step 1/27 : FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
3.1: Pulling from dotnet/aspnet
no matching manifest for windows/amd64 10.0.14393 in the manifest list entries
##[error]The process 'C:\Program Files\Docker\docker.exe' failed with exit code 1
Finishing: Spice buildAndPush
然后我将代理更改为 windows-2019 并再次运行。这次没有标记错误 ->
然后通过运行 Ubuntu 管道解决此问题。我正在使用 VS 2019、Selenium 4.0.0、NUnit 3.13.3、Specflow 3.9.22
这是最后一步使用的 Docker 文件
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["spicetheworld.csproj", "./"]
RUN dotnet restore "spicetheworld.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "spicetheworld.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "spicetheworld.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "spicetheworld.dll"]
请问有人知道我哪里出错了吗?
【问题讨论】:
标签: azure visual-studio selenium azure-devops specflow