How to copy folders to docker image from Dockerfile?

后端 未结 10 665
走了就别回头了
走了就别回头了 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:12

    use ADD instead of COPY. Suppose you want to copy everything in directory src from host to directory dst from container:

    ADD src dst
    

    Note: directory dst will be automatically created in container.

提交回复
热议问题