How to access root-folder from dockerfile which isn't in root

I have a package.json in my root folder.
I have another folder in the root: server.
In this /server folder I have a Dockerfile so /server/Dockerfile
How can I access this package.json from my Dockerfile?

Setup:

  • Kitchen login failed :Could not resolve host name
  • distribute docker containers evenly with kubectl
  • Docker windows loading kernel modules
  • How to have default file in image that I can override during container run?
  • Unable to connect to docker hub from China
  • Re-mount volume in a running container
    • /source
    • /server
      • Dockerfile
    • package.json

  • How to encode an arbitrary command to a exec form in Dockerfile?
  • Docker compose not exposing port for application container
  • Start a service in docker container failed,with error: Failed to get D-Bus connection: No connection to service manager
  • Docker File and execute phpize error
  • How can I upgrade openshift origin if it is run as a docker container?
  • Unable to start any container when Volumes are enabled Docker Toolbox
  • One Solution collect form web for “How to access root-folder from dockerfile which isn't in root”

    You need to have a build script which will:

    • copy /package.json to the /server folder
    • call docker build -t xxx .

    There is an issue opened for requesting support for symlink

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