Copy file(s) within the container in Dockerfile

随声附和 提交于 2021-01-28 22:50:42

问题


How can I copy a file from a path within the container to a different path within that same container in a Dockerfile during the docker-compose build process?

COPY <src> <dest>

This copies a file from the host outside the container. I don't know how to have <src> specify a file inside the container to copy.


回答1:


as @tkausl and @JohnKugelman pointed out files can be copied by the following command syntax:

RUN cp <src-path-within-the-container> <dest-path-within-the-container>


来源:https://stackoverflow.com/questions/63058057/copy-files-within-the-container-in-dockerfile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!