gpt4 book ai didi

docker - 为什么 docker 没有完全删除我的文件?

转载 作者:行者123 更新时间:2023-12-02 17:54:59 27 4
gpt4 key购买 nike

我正在尝试使用:

FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS builder

COPY pythonnet/src/ pythonnet/src
WORKDIR /pythonnet/src/runtime
RUN dotnet build -f netstandard2.0 -p:DefineConstants=\"MONO_LINUX\;XPLAT\;PYTHON3\;PYTHON37\;UCS4\;NETSTANDARD\" Python.Runtime.15.csproj

# copy myApp csproj and restore
COPY src/myApp/*.csproj /src/myApp/
WORKDIR /src/myApp
RUN dotnet restore

# now copy everything else as separate docker step
# (copy to staging folder, remove csproj, and copy down - so we don't overwrite project above)
WORKDIR /
COPY src/myApp/ ./staging/src/myApp
RUN rm ./staging/src/myApp/*.csproj \
&& cp -r ./staging/* ./ \
&& rm -rf ./staging
这工作正常,在 Windows 10 中仍然可以,但在 CentOS 7 中我得到:
Step 10/40 : RUN rm ./staging/src/myApp/*.csproj  && cp -r ./staging/* ./ && rm -rf ./staging
---> Running in 6b17ae0fae89
cp: cannot stat './staging/src/myApp/myApp.csproj': No such file or directory
使用 ls而不是 cp抛出类似的文件未找到错误,所以看起来 Docker 仍然知道 myApp.csproj但由于它已被删除,因此无法看到它。
有没有解决的办法?我试过使用 rsync但类似的问题。

最佳答案

我只是通过添加 ;exit 0 忽略了这个问题。在有问题的线上。不是很好,但可以完成工作。
编辑:这对我有用,因为我无法升级 CemtOS 的版本。如果可以,请查看 Alexander Block 的答案。

关于docker - 为什么 docker 没有完全删除我的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62596848/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com