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:

  • Dockerfile VOLUME not working
  • Docker drop changes on restart
  • Is it possible to show the `WORKDIR` when building a docker image?
  • Docker find all layers in an image
  • Get all running Docker containers whose image is derived from a specific image
  • Rsync “permission denied” error using Vagrant's docker provider on Windows
    • /source
    • /server
      • Dockerfile
    • package.json

  • How to properly launch an OpenShift v3 app
  • docker compose and jenkins
  • Auto-reloading of code changes with Django development in Docker with Gunicorn
  • AWS Elastic Beanstalk, Dockerrun.aws.json and multiple ports on docker run [duplicate]
  • Running bvlc-caffe docker image as non-root user results in unexpected NVCC flags
  • how to run kafka from docker landoop image
  • 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.