0

I'm new to using Docker and wanted to understand how to add large folders (combined ~1GB) kept elsewhere (such as in SharePoint) to the Docker container using Dockerfile. What is the best way to add the files and can someone explain the commands to be used? For example, one method I have come across is the following:

ADD http://example.com/big.tar.xz /usr/src/things/

Does the /usr/src/things/ specify the location where I want to save the folders (not individual files) with respect to my original repository?

This answer is from: Adding large files to docker during build which covers the question at a high level. Can someone share details/commands for each step involved? One answer mentions not adding the files to the image but mounting as a volume. Is that a better option than using ADD in the Dockerfile.

Thanks!

beta
  • 63
  • 5
  • You can `COPY` (or `ADD`) it into the image, or you can mount it into the container, but you can't specify in the Dockerfile that a specific thing must be mounted when the container runs. Which path is better depends on whether the size of the image is actually a problem and how usable your image is without that data embedded. – David Maze Aug 26 '22 at 13:17
  • Thanks for sharing @DavidMaze! The files are essential for running the different endpoints in the project code. Another question is around authorization/security. If I have the link to the files/folder but it is, say, behind a specific IP and needs authorization, how do I specify those details in the Dockerfile? Considering using Azure Blob Storage to save the files and then use a link to add to the image. – beta Aug 29 '22 at 05:27

0 Answers0