[英]Docker build gives error when run with codepipeline aws
當我使用 AWS CodePipeline 運行 Dockerfile 時出現以下錯誤
Step 2/4 : COPY src /app
COPY failed: file not found in build context or excluded by .dockerignore: stat src: file does not exist
這是 buildspec.yml 中使用的命令
docker build --tag $REPOSITORY_URI:$TAG -f app/Dockerfile
。
文件夾結構為:
Microservice1/
|-app/
|- src/
|- Dockerfile
|-buildspec.yml
您正在 $Microservice1 目錄中執行命令。
命令末尾的點 (.) 指示使用構建上下文作為當前目錄。
Docker 構建上下文只能看到app/src,只有src不可見。
或者,從 $Microservice1/app 目錄執行命令。 您可能需要稍微更改 Dockerfile。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.