Docker Community Forums

Share and learn in the Docker community.

Add file after build done

Hi everyone,

i have a question about addinf files to a docker already built.
My probleme is that i have an application that i put in a container, and it need a csv file to be executed, and this csv file is uploaded by the user.
All the answers i road were about using a docker volume, but the personn who want to run the application usually don"t know what is it.
I tried this manip in Docekrfile:
ARG file
COPY file /destination

but it fails at build.

My question is can i add a file to a container after the build without using volumes or the command “docker cp”.

Please HELP !!!

Either you use a bind or named volume with a source path on the host and map it to a path in the container, or your stick witch docker cp.

The most user friendly approach, though, is to add a file upload dialog in your application. Everyone knows how to use them :wink:

1 Like