我正在尝试使用VSTS和docker-组合来配置连续传递,我想将其推送到Azure容器注册表中。下面是我在VSTS上的构建定义:
我收到一条关于构建结果的错误消息:
No such command: docker_compose
Commands:
build Build or rebuild services
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
down Stop and remove
我是码头新来的。我的项目的目录结构如下
docker-compose.yml
|-services
|-orders
|-DockerFile
我使用的标准ASP.Net核心DockerFile具有以下内容:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY ["Services/Orders/Orders.csproj",
我在这台计算机上做了2-3个月的相同的dotnet项目,只有在安装了JetBrains Rider之后,我才得到了一个惊喜。运行dotnet restore没有输出任何内容,运行dotnet build、dotnet watch build或类似的东西会输出一个错误,内容如下:
error NETSDK1004: Assets file project.assets.json not found. Run a NuGet package restore to generate this file.
最糟糕的是,dotnet build因为一个错误而失败了,但是msbuild运行在同一个项目上,
这是我第一次使用newbie,所以我在这方面是个新手。
Visual 2017最新更新码头18.03.1
我已经做了一个在Visual中运行良好的项目,现在我想将它部署到我的本地Docker。
我按照有关构建和运行的说明在这里运行:
如果我尝试在本地运行ASP.NET应用程序,我可以得到以下内容:
dotnet run
C:\Users\barn\source\repos\FLG\docker-compose.dcproj : error MSB4236: The SDK 'Microsoft.Docker.Sdk' specified could not be found
当我试图通过docker (在windows,wsl上)运行dotnet watch时,我会得到一个类似于Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: /src/bin/Debug/net5.0/Tickets.runtimeconfig.json的错误。Key: ...总是不同的。
此错误有时在构建时发生:
app-watch_1 | Building...
app-watch_1 | Unhandled exception. Sy
问题:
我在一个docker-come.yml文件中指定的容器中运行两个ASP.Net Core。这些ASP.Net核心项目是与其他项目一起解决方案的一部分。在我的停靠-撰写文件中,我指定了一个卷,它将我的解决方案文件夹映射到两个容器(用于调试器/ dotnet )。
当我启动对接-撰写时,我从Visual和Rider获得错误,如:The type or namespace name 'ISomeService' could not be found
此外,我还看到针对/obj和/bin文件夹中文件的权限错误。
当我停止停靠堆栈并删除解决方案中每个项目的obj和bin文件夹时,
我试图上传我的项目到一个数字海洋液滴使用对接我困在这个阶段,在那里复制失败,每当我运行对接-合成构建。
Dockerfile:
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 ["iCoose.API/iChoose.API.csproj", "iCoose.API/
我无法使用Rider将调试器附加到我的码头容器应用程序。它在Visual Studio (运行和调试)下工作得很好,并且只有在使用Rider时才能'run‘,但是当我试图在Rider上'run debug’时,应用程序试图启动,但在那之后,所有的容器都退出了,并返回了代码139和以下错误: LTTng-UST: Error (-17) while registering tracepoint probe. Duplicate registration of tracepoint probes having the same name is not allowed. ?
我从Visual 2019年创建了以下简单的dotnet核心控制台应用程序。
Console.WriteLine("Hello World!");
var readText = Console.ReadLine();
Console.WriteLine(readText);
然后,我向这个控制台项目添加了docker支持。我已经在另一个中编写了一步一步的指令来添加对接支持。
在命令提示符中,我现在导航到存在docker-组合文件的文件夹,并发出以下命令
docker-compose run <service name from docker-compose.yml f
在我的Dockerfile里
FROM microsoft/dotnet:2.1-sdk
COPY devops/scripts/setup.sh .
RUN ls
RUN chmod +x ./setup.sh
RUN ./setup.sh
WORKDIR /app
第三步,我使用的只是显示文件实际上是存在的。
在Linux上运行docker-compose up时,在Windows上运行docker-compose up会导致
> docker-compose up
Building create_template
Step 1/6 : FROM microsoft/dotnet:
我创建了一个控制台应用程序来使用运行基准测试。此应用程序被打包到一个Docker容器中,它是docker-组合场景的一部分。ENTRYPOINT of The dockerfile如下所示:
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Benchmarks.dll", "-f", "*"]
这些args指示Benchmark.Net库运行该程序集中的所有测试。
The problem:参数从未传递
我的Ubuntu系统上有.NET 6和.NET 7。当我试图在Rider中执行一个测试时,它说没有安装dotnet 6。但它是。如果我运行dotnet --list-runtimes,它只显示.NET 7。
控制台输出:
Reading state information... Done
aspnetcore-runtime-6.0 is already the newest version (6.0.110-0ubuntu1~22.04.1).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
aaronlord@