加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

amazon-web-services – COPY没有指定源文件

发布时间:2020-12-16 03:55:38 所属栏目:安全 来源:网络整理
导读:我试图将docker容器部署到AWS CodeBuild,并且它继续执行以下步骤: COPY dist/* /var/www/html/ 我确定那个目录里面有东西,只是为了确保我运行命令ls dist: Step 4 : RUN ls dist--- Running in cc6a985f54dd1.1.329fd43c10e3d0fc91b9.js3.3.d0a0148e036318

我试图将docker容器部署到AWS CodeBuild,并且它继续执行以下步骤:

COPY dist/* /var/www/html/

我确定那个目录里面有东西,只是为了确保我运行命令ls dist:

Step 4 : RUN ls dist
---> Running in cc6a985f54dd
1.1.329fd43c10e3d0fc91b9.js
3.3.d0a0148e036318c95bfe.js
4.4.d85fbfa6409009fb6e4c.js
app.a6626f87bbfc6e67618d.js
app.cd527cf8dea96798229c62fb7d983606.css
favicon.ico
humans.txt
index.html
robots.txt
vendor.d81f28030613dd8760c0.js

我的dockerfile:

FROM jaronoff/listmkr-prod
# Remove the default nginx index.html
RUN rm -rf /var/www/html/index.nginx-debian.html

RUN npm run deploy:prod
# Copy the contents of the dist directory over to the nginx web root

RUN ls dist

COPY dist/* /var/www/html/
# Expose the public http port
EXPOSE 80
# Start server
CMD ["nginx","-g","daemon off;"]
最佳答案
Dockerfile COPY命令将文件从构建“上下文”复制到您的图像中.构建上下文是您在构建命令结束时传递的文件夹.例如.在docker build -t myimage:latest.命令,.是你的背景.要使用COPY命令,需要存在“dist / *”.

您的RUN ls dist命令列出了您正在构建的图像内的目录.如果要将文件从图像中的一个位置复制到另一个位置,您可以:

RUN cp -a dist/* /var/www/html/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读