Link to home
Start Free TrialLog in
Avatar of enthuguy
enthuguyFlag for Australia

asked on

Docker - Copy file to a location during docker run

Hi Docker experts,

as part of docker run, i mount a NFS volume to the container,

but inside the container, would like to copy a file from the mounted volume and copy to a different location inside the container during docker run

since files in this volume will be more dynamic. I can only copy file after mounting

please suggest/advice
Avatar of David Favor
David Favor
Flag of United States of America image

Keep in mind Docker has no concept of persistent data, so you'll do this by allocating some directory (called a Docker volume) which will only be used by your Docker instance + no other code.

Then as container starts, copy the NFS file to the local Docker volume.
Avatar of noci
noci

Why not have the NFS volume mounted on  a -v exported directory.
And use the NFS  volume. to manipulate all data.
ASKER CERTIFIED SOLUTION
Avatar of Prabhin MP
Prabhin MP
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial