- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
目标是将图像推送到 dockerhub,这在 Visual Studio 的“发布”功能中效果很好。
我有这个 Dockerfile:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj", "DockerTestWebsiteLinux/"]
RUN dotnet restore "DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj"
COPY . .
WORKDIR "/src/DockerTestWebsiteLinux"
RUN dotnet build "DockerTestWebsiteLinux.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "DockerTestWebsiteLinux.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DockerTestWebsiteLinux.dll"]
这是使用 VS2019 最新版本生成的空白 ASP.NET Core 项目的默认项目。
管道 YAML 如下所示:
steps:
- task: Docker@0
displayName: 'Build an image'
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryConnection: 'docker hub jc'
dockerFile: DockerTestWebsiteLinux/Dockerfile
(这是当您单击“Docker”作为作业时出现的默认项目,我只更改了 dockerfile 的路径,因为它是解决方案中众多项目中的一个)
他似乎发现 Dockerfile 很好,但随后存在
Step 6/16 : COPY ["DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj", "DockerTestWebsiteLinux/"]
COPY failed: stat /var/lib/docker/tmp/docker-builder071437444/DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj: no such file or directory
##[error]COPY failed: stat /var/lib/docker/tmp/docker-builder071437444/DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj: no such file or directory
##[error]/usr/bin/docker failed with return code: 1
我做错了什么?
完整日志是:
2020-06-12T11:19:12.4891643Z ##[section]Starting: Build an image
2020-06-12T11:19:12.4903893Z ==============================================================================
2020-06-12T11:19:12.4904229Z Task : Docker
2020-06-12T11:19:12.4904567Z Description : Build, tag, push, or run Docker images, or run a Docker command
2020-06-12T11:19:12.4904871Z Version : 0.157.2
2020-06-12T11:19:12.4905150Z Author : Microsoft Corporation
2020-06-12T11:19:12.4905502Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/docker
2020-06-12T11:19:12.4905906Z ==============================================================================
2020-06-12T11:19:12.9134260Z c99ab064-584c-4340-b58e-7a19ca76f6b8 exists true
2020-06-12T11:19:12.9842066Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9842743Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9843349Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9843985Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9844543Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9845090Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9845644Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9846187Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9846740Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9847280Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9847830Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9848370Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9848914Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9849468Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9850017Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9850568Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9851111Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9851662Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9852200Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9852750Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9853292Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9853843Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9854385Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9855199Z (node:3877) Warning: Use Cipheriv for counter mode of aes-256-ctr
2020-06-12T11:19:12.9859182Z [command]/usr/bin/docker build -f /home/vsts/work/9/s/DockerTestWebsiteLinux/Dockerfile -t mlatwork:256 /home/vsts/work/9/s/DockerTestWebsiteLinux
2020-06-12T11:19:13.4004892Z Sending build context to Docker daemon 11.78kB
2020-06-12T11:19:13.4005606Z
2020-06-12T11:19:13.4565372Z Step 1/16 : FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
2020-06-12T11:19:13.6021599Z 3.1-buster-slim: Pulling from dotnet/core/aspnet
2020-06-12T11:19:13.6038540Z 8559a31e96f4: Pulling fs layer
2020-06-12T11:19:13.6044182Z dc08029e21f9: Pulling fs layer
2020-06-12T11:19:13.6044508Z 734d0e250adf: Pulling fs layer
2020-06-12T11:19:13.6044768Z 84249fbd30d6: Pulling fs layer
2020-06-12T11:19:13.6045041Z 84d07bfbfd3f: Pulling fs layer
2020-06-12T11:19:13.6045286Z 84249fbd30d6: Waiting
2020-06-12T11:19:13.6045529Z 84d07bfbfd3f: Waiting
2020-06-12T11:19:13.6905803Z 734d0e250adf: Download complete
2020-06-12T11:19:13.8902364Z dc08029e21f9: Verifying Checksum
2020-06-12T11:19:13.8904333Z dc08029e21f9: Download complete
2020-06-12T11:19:13.9788197Z 8559a31e96f4: Verifying Checksum
2020-06-12T11:19:13.9793870Z 8559a31e96f4: Download complete
2020-06-12T11:19:14.0424733Z 84249fbd30d6: Verifying Checksum
2020-06-12T11:19:14.0429176Z 84249fbd30d6: Download complete
2020-06-12T11:19:14.0836902Z 84d07bfbfd3f: Verifying Checksum
2020-06-12T11:19:14.0846946Z 84d07bfbfd3f: Download complete
2020-06-12T11:19:15.1361383Z 8559a31e96f4: Pull complete
2020-06-12T11:19:15.7092876Z dc08029e21f9: Pull complete
2020-06-12T11:19:15.8149265Z 734d0e250adf: Pull complete
2020-06-12T11:19:16.5138806Z 84249fbd30d6: Pull complete
2020-06-12T11:19:16.7693218Z 84d07bfbfd3f: Pull complete
2020-06-12T11:19:16.7722239Z Digest: sha256:b5ca2387bc65608bed936c04f40ddd92e8b6a5a3387f38a210e18d531080f2ca
2020-06-12T11:19:16.7751385Z Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
2020-06-12T11:19:16.7759194Z ---> 7e3fe71c7693
2020-06-12T11:19:16.7759605Z Step 2/16 : WORKDIR /app
2020-06-12T11:19:20.0241824Z ---> Running in 5f40e0c57f8f
2020-06-12T11:19:21.0254992Z Removing intermediate container 5f40e0c57f8f
2020-06-12T11:19:21.0256309Z ---> 781ae87ed64e
2020-06-12T11:19:21.0256726Z Step 3/16 : EXPOSE 80
2020-06-12T11:19:21.0753001Z ---> Running in f63a9f7f81a0
2020-06-12T11:19:22.0301005Z Removing intermediate container f63a9f7f81a0
2020-06-12T11:19:22.0302213Z ---> 7a89f78b321c
2020-06-12T11:19:22.0302737Z Step 4/16 : FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
2020-06-12T11:19:22.1082117Z 3.1-buster: Pulling from dotnet/core/sdk
2020-06-12T11:19:22.1082686Z e9afc4f90ab0: Pulling fs layer
2020-06-12T11:19:22.1083039Z 989e6b19a265: Pulling fs layer
2020-06-12T11:19:22.1083406Z af14b6c2f878: Pulling fs layer
2020-06-12T11:19:22.1083748Z 5573c4b30949: Pulling fs layer
2020-06-12T11:19:22.1084108Z 17f039feca24: Pulling fs layer
2020-06-12T11:19:22.1084451Z a739c871edc6: Pulling fs layer
2020-06-12T11:19:22.1084919Z 8d7e6a1ea13e: Pulling fs layer
2020-06-12T11:19:22.1085152Z 17f039feca24: Waiting
2020-06-12T11:19:22.1085370Z a739c871edc6: Waiting
2020-06-12T11:19:22.1085614Z 8d7e6a1ea13e: Waiting
2020-06-12T11:19:22.1085832Z 5573c4b30949: Waiting
2020-06-12T11:19:22.2752636Z 989e6b19a265: Verifying Checksum
2020-06-12T11:19:22.2753050Z 989e6b19a265: Download complete
2020-06-12T11:19:22.2890385Z af14b6c2f878: Verifying Checksum
2020-06-12T11:19:22.2890748Z af14b6c2f878: Download complete
2020-06-12T11:19:22.4478115Z 17f039feca24: Verifying Checksum
2020-06-12T11:19:22.4478471Z 17f039feca24: Download complete
2020-06-12T11:19:22.7472123Z e9afc4f90ab0: Verifying Checksum
2020-06-12T11:19:22.7472472Z e9afc4f90ab0: Download complete
2020-06-12T11:19:22.9057708Z 5573c4b30949: Verifying Checksum
2020-06-12T11:19:22.9059825Z 5573c4b30949: Download complete
2020-06-12T11:19:23.0119160Z 8d7e6a1ea13e: Verifying Checksum
2020-06-12T11:19:23.0120321Z 8d7e6a1ea13e: Download complete
2020-06-12T11:19:23.7463177Z a739c871edc6: Verifying Checksum
2020-06-12T11:19:23.7464827Z a739c871edc6: Download complete
2020-06-12T11:19:24.9514807Z e9afc4f90ab0: Pull complete
2020-06-12T11:19:25.2664959Z 989e6b19a265: Pull complete
2020-06-12T11:19:25.5500940Z af14b6c2f878: Pull complete
2020-06-12T11:19:27.5001594Z 5573c4b30949: Pull complete
2020-06-12T11:19:27.8404155Z 17f039feca24: Pull complete
2020-06-12T11:19:31.4556340Z a739c871edc6: Pull complete
2020-06-12T11:19:31.9511844Z 8d7e6a1ea13e: Pull complete
2020-06-12T11:19:31.9534709Z Digest: sha256:1616a64f2eb95e1d9bc0f7185cff16aa44ce0f63c8f61d6bebac5f810d580711
2020-06-12T11:19:31.9550718Z Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/sdk:3.1-buster
2020-06-12T11:19:31.9558815Z ---> 5f369f0d8192
2020-06-12T11:19:31.9559092Z Step 5/16 : WORKDIR /src
2020-06-12T11:19:40.3165947Z ---> Running in 9d104c6e7d2b
2020-06-12T11:19:41.0594271Z Removing intermediate container 9d104c6e7d2b
2020-06-12T11:19:41.0595329Z ---> d49cec115c36
2020-06-12T11:19:41.0595671Z Step 6/16 : COPY ["DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj", "DockerTestWebsiteLinux/"]
2020-06-12T11:19:41.0596514Z COPY failed: stat /var/lib/docker/tmp/docker-builder071437444/DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj: no such file or directory
2020-06-12T11:19:41.0645016Z ##[error]COPY failed: stat /var/lib/docker/tmp/docker-builder071437444/DockerTestWebsiteLinux/DockerTestWebsiteLinux.csproj: no such file or directory
2020-06-12T11:19:41.0800905Z ##[error]/usr/bin/docker failed with return code: 1
2020-06-12T11:19:41.0837329Z ##[section]Finishing: Build an image
编辑:我使问题更具可重现性:
1) 创建一个具有 Docker 支持的空 ASP.NET Core 项目2) 将该项目上传到 Azure Devops GIT 存储库3)创建管道,选择“Docker build”作为任务
默认管道如下所示:
# Docker
# Build a Docker image
# https://learn.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Docker@2
displayName: Build an image
inputs:
command: build
dockerfile: '$(Build.SourcesDirectory)/AzureDevopsDockerTest/Dockerfile'
tags: |
$(tag)
但它仍然存在:
Step 7/26 : COPY ["AzureDevopsDockerTest/AzureDevopsDockerTest.csproj", "AzureDevopsDockerTest/"]
COPY failed: stat /var/lib/docker/tmp/docker-builder580556181/AzureDevopsDockerTest/AzureDevopsDockerTest.csproj: no such file or directory
##[error]COPY failed: stat /var/lib/docker/tmp/docker-builder580556181/AzureDevopsDockerTest/AzureDevopsDockerTest.csproj: no such file or directory
##[error]The process '/usr/bin/docker' failed with exit code 1
本例中的 dockerfile:
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["AzureDevopsDockerTest/AzureDevopsDockerTest.csproj", "AzureDevopsDockerTest/"]
RUN dotnet restore "AzureDevopsDockerTest/AzureDevopsDockerTest.csproj"
COPY . .
WORKDIR "/src/AzureDevopsDockerTest"
RUN dotnet build "AzureDevopsDockerTest.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "AzureDevopsDockerTest.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AzureDevopsDockerTest.dll"]
最佳答案
最好的方法(对我也有用)是避免任何硬编码并使用上下文,如下例所示:
buildContext: $(Build.Repository.LocalPath)
关于来自 IFSC 代码的 Azure Devops Docker 镜像没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62343444/
今天我在一个 Java 应用程序中看到了几种不同的加载文件的方法。 文件:/ 文件:// 文件:/// 这三个 URL 开头有什么区别?使用它们的首选方式是什么? 非常感谢 斯特凡 最佳答案 file
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我有一个 javascript 文件,并且在该方法中有一个“测试”方法,我喜欢调用 C# 函数。 c# 函数与 javascript 文件不在同一文件中。 它位于 .cs 文件中。那么我该如何管理 j
需要检查我使用的文件/目录的权限 //filePath = path of file/directory access denied by user ( in windows ) File fil
我在一个目录中有很多 java 文件,我想在我的 Intellij 项目中使用它。但是我不想每次开始一个新项目时都将 java 文件复制到我的项目中。 我知道我可以在 Visual Studio 和
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我有 3 个组件的 Twig 文件: 文件 1: {# content-here #} 文件 2: {{ title-here }} {# content-here #}
我得到了 mod_ldap.c 和 mod_authnz_ldap.c 文件。我需要使用 Linux 命令的 mod_ldap.so 和 mod_authnz_ldap.so 文件。 最佳答案 从 c
我想使用PIE在我的项目中使用 IE7。 但是我不明白的是,我只能在网络服务器上使用 .htc 文件吗? 我可以在没有网络服务器的情况下通过浏览器加载的本地页面中使用它吗? 我在 PIE 的文档中看到
我在 CI 管道中考虑这一点,我应该首先构建和测试我的应用程序,结果应该是一个 docker 镜像。 我想知道使用构建环境在构建服务器上构建然后运行测试是否更常见。也许为此使用构建脚本。最后只需将 j
using namespace std; struct WebSites { string siteName; int rank; string getSiteName() {
我是 Linux 新手,目前正在尝试使用 ginkgo USB-CAN 接口(interface) 的 API 编程功能。为了使用 C++ 对 API 进行编程,他们提供了库文件,其中包含三个带有 .
我刚学C语言,在实现一个程序时遇到了问题将 test.txt 文件作为程序的输入。 test.txt 文件的内容是: 1 30 30 40 50 60 2 40 30 50 60 60 3 30 20
如何连接两个tcpdump文件,使一个流量在文件中出现一个接一个?具体来说,我想“乘以”一个 tcpdump 文件,这样所有的 session 将一个接一个地按顺序重复几次。 最佳答案 mergeca
我有一个名为 input.MP4 的文件,它已损坏。它来自闭路电视摄像机。我什么都试过了,ffmpeg , VLC 转换,没有运气。但是,我使用了 mediainfo和 exiftool并提取以下信息
我想做什么? 我想提取 ISO 文件并编辑其中的文件,然后将其重新打包回 ISO 文件。 (正如你已经读过的) 我为什么要这样做? 我想开始修改 PSP ISO,为此我必须使用游戏资源、 Assets
给定一个 gzip 文件 Z,如果我将其解压缩为 Z',有什么办法可以重新压缩它以恢复完全相同的 gzip 文件 Z?在粗略阅读了 DEFLATE 格式后,我猜不会,因为任何给定的文件都可能在 DEF
我必须从数据库向我的邮件 ID 发送一封带有附件的邮件。 EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Adventure Works Admin
我有一个大的 M4B 文件和一个 CUE 文件。我想将其拆分为多个 M4B 文件,或将其拆分为多个 MP3 文件(以前首选)。 我想在命令行中执行此操作(OS X,但如果需要可以使用 Linux),而
快速提问。我有一个没有实现文件的类的项目。 然后在 AppDelegate 我有: #import "AppDelegate.h" #import "SomeClass.h" @interface A
我是一名优秀的程序员,十分优秀!