Docker副本[.dll]

Docker副本[.dll],docker,dockerfile,Docker,Dockerfile,我在Docker上创建.NET核心应用程序映像时遇到问题。基本上在图片中你可以看到这是一个DLL文件,我在我的项目中添加了它作为参考。虽然正常的IIS构建项目可以顺利构建和运行,但当我尝试创建映像时,会出现以下错误。据我所知,docker找不到DLL。我正在使用Linux Docker服务器 此外,如果我从“桌面Docker”运行Docker,它会平稳运行,但如果我使用“Docker Terminal”创建图像,则会出现以下错误 Build FAILED. /usr/share/dotnet/s

我在Docker上创建.NET核心应用程序映像时遇到问题。基本上在图片中你可以看到这是一个DLL文件,我在我的项目中添加了它作为参考。虽然正常的IIS构建项目可以顺利构建和运行,但当我尝试创建映像时,会出现以下错误。据我所知,docker找不到DLL。我正在使用Linux Docker服务器

此外,如果我从“桌面Docker”运行Docker,它会平稳运行,但如果我使用“Docker Terminal”创建图像,则会出现以下错误

Build FAILED.
/usr/share/dotnet/sdk/2.1.803/Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "xxxxxx.Data.Core". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
Repository/SqlRepository.cs(1,7): error CS0246: The type or namespace name 'xxxxxx' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
UnitOfWork/UnitOfWork.cs(1,7): error CS0246: The type or namespace name 'xxxxxx' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
UnitOfWork/UnitOfWork.cs(2,7): error CS0246: The type or namespace name 'xxxxxx' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
UnitOfWork/UnitOfWork.cs(13,31): error CS0246: The type or namespace name 'IUnitOfWork' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
UnitOfWork/UnitOfWork.cs(30,16): error CS0246: The type or namespace name 'IRepository<>' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
Repository/SqlRepository.cs(16,43): error CS0246: The type or namespace name 'RepositoryBase' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
Repository/SqlRepository.cs(16,59): error CS0246: The type or namespace name 'IRepository<>' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
UnitOfWork/UnitOfWork.cs(18,22): error CS0246: The type or namespace name 'RepositoryBase' could not be found (are you missing a using directive or an assembly reference?) [/src/abcproject.Voucher.MySql/abcproject.Voucher.MySql.csproj]
    1 Warning(s)
    8 Error(s)

Time Elapsed 00:00:15.67
The command '/bin/sh -c dotnet build "abcproject.Voucher.API.csproj" -c Release -o /app/build' returned a non-zero code: 1

这是我运行以创建图像的命令:

docker build -t myimage -f "abcproject.Voucher.API/Dockerfile" .

将引用的.dll移动到包含.csproj文件的项目主目录。Docker将从那里挑选。此外,请使用副本\

将引用的.dll移动到包含.csproj文件的项目主目录。Docker将从那里挑选。此外,请使用副本\

您实际运行的命令是什么?你犯了什么错误?请将这些详细信息以文本(而非图片)的形式直接包含在问题中(而不是链接后面)。@DavidMaze我已编辑了上述问题。据我所知,docker映像无法找到我在项目中作为引用添加的dll。我对docker有点陌生,你能给我进一步的指导吗。提前谢谢你@Fahad您需要发布Dockerfile和运行Dockerfile所用的命令。此外,如果你能将问题的格式设置为便于读者阅读,那也很好。@GaneshSatpute已经编辑了这个问题。谢谢你,先生@DavidMaze我正在运行的实际命令是:docker build-t myimage-f“abcproject.concedure.API/Dockerfile”。您正在运行的实际命令是什么?你犯了什么错误?请将这些详细信息以文本(而非图片)的形式直接包含在问题中(而不是链接后面)。@DavidMaze我已编辑了上述问题。据我所知,docker映像无法找到我在项目中作为引用添加的dll。我对docker有点陌生,你能给我进一步的指导吗。提前谢谢你@Fahad您需要发布Dockerfile和运行Dockerfile所用的命令。此外,如果你能将问题的格式设置为便于读者阅读,那也很好。@GaneshSatpute已经编辑了这个问题。谢谢你,先生@DavidMaze我正在运行的实际命令是:dockerbuild-tmyimage-f“abcproject.document.API/Dockerfile”。
docker build -t myimage -f "abcproject.Voucher.API/Dockerfile" .