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:

  • Managing remote docker machines from multiple development machines
  • Docker daemon wont start , do i need something configuration before?
  • docker networking direct access to container
  • How to connect to mongodb using docker-compose?
  • Unable to start node app with shell script
  • Docker build tag repository name
    • /source
    • /server
      • Dockerfile
    • package.json

  • Is it safe to delete docker logs generated at /var/lib/docker/containers/HASH
  • Jenkins Plugin for Docker Engine on Windows
  • docker-compose: how to map few ip to few containers
  • Persist data only for selected volumes with docker-compose
  • AWS Multicontainer Docker using PHP and NGinx to install Laravel
  • Do I need a reverse proxy if I'm running a Node.js in a Docker container?
  • 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.