Docker follow symlink outside context

后端 未结 5 2169
梦如初夏
梦如初夏 2020-12-05 12:54

Yet another Docker symlink question. I have a bunch of files that I want to copy over to all my Docker builds. My dir structure is:

parent_dir
    - common_f         


        
5条回答
  •  甜味超标
    2020-12-05 13:11

    One possibility is to run the build in the parent directory, with:

    $ docker build [tags...] -f dir1/Dockerfile .
    

    (Or equivalently, in child directory,)

    $ docker build  [tags...] -f Dockerfile ..
    

    The Dockerfile will have to be configured to do copy/add with appropriate paths. Depending on your setup, you might want a .dockerignore in the parent to leave out things you don't want to be put into the context.

提交回复
热议问题