In Dockerfile how to copy file from network drive

I have a file hosted (can’t change that) at //somenetwork/somefiles/myfile

In my Dockerfile I would like to:

  • Using a shared MySQL container
  • Building older gcc inside Docker container
  • docker registry push failed on localhost
  • Angular 2 app deploy in a docker Container running on AWS
  • How do you set encrypted Travis env variables in docker?
  • Vagrant multi-machine with docker tries to create two boot2docker vms
  • COPY //somenetwork/somefiles/myfile /opt/files/file

    Is there anyway to achieve that with Dockerfile?

  • docker0 interface missing on osx
  • How do you setup a Docker swarm on Raspberry Pis with one external (USB) storage device?
  • Apache Flink 1.2 - Client is not connected to any Elasticsearch nodes
  • Why would a service that works locally be getting kill signals frequently in docker?
  • Running MariaDB in a docker container using docker stack
  • Docker for Windows cleanup
  • One Solution collect form web for “In Dockerfile how to copy file from network drive”

    Not easily, considering ADD or COPY uses the Dockerfile context (the current folder or below) to seek their resources.

    It would be easier to cp that file first to the Dockerfile folder (before a docker build .), and leave in said Dockerfile a COPY myfile /opt/files/file directive.

    Or you could run the container, and use a docker cp //somenetwork/somefiles/myfile /opt/files/file to add that file at rintime

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.