How to include files outside of Docker's build context?

前端 未结 14 1207
情话喂你
情话喂你 2020-11-22 07:21

How can I include files from outside of Docker\'s build context using the \"ADD\" command in the Docker file?

From the Docker documentation:

T

14条回答
  •  面向向阳花
    2020-11-22 07:34

    An easy workaround might be to simply mount the volume (using the -v or --mount flag) to the container when you run it and access the files that way.

    example:

    docker run -v /path/to/file/on/host:/desired/path/to/file/in/container/ image_name
    

    for more see: https://docs.docker.com/storage/volumes/

提交回复
热议问题