报错信息:
error building image: error building stage: failed to optimize
instructions: failed to get files used from context: when specifying
multiple sources in a COPY command, destination must be a directory
and end in ‘/’
在做gitlab-ci自动化部署的时候,Pipelines执行的时候报了如上的错。我的一个小需求是将一个外部jar包移动到docker容器里面并重命名。下面是当时我写的Dockerfile的一个命令

报错原因:因为*匹配了不止一个jar包,当时没注意我这个目录下有两个jar包
解决:目标文件改成目录的形式,或者只保证有一个jar包
在GitLab-CI自动化部署过程中遇到Dockerfile错误,原因是COPY命令处理多个jar包时目标路径不正确。解决方案是确保目标为目录或确保只有一个jar包。修正Dockerfile的COPY命令以避免文件冲突。

被折叠的 条评论
为什么被折叠?



