How to copy folders to docker image from Dockerfile?

后端 未结 10 828
走了就别回头了
走了就别回头了 2021-01-31 01:41

I tried the following command in my Dockerfile: COPY * / and got mighty surprised at the result. Seems the naive docker code traverses the directories from the glob

10条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 02:24

    the simplest way:

    sudo docker cp path/on/your/machine adam_ubuntu:/root/path_in_container
    

    Note putting into the root path if you are copying something that needs to be picked up by the root using ~.

提交回复
热议问题