0

Main Project

  • Utils
  • Auth
  • MyProject
    • Dockerfile

For MyProject to run I need to build the contents in Utils and Auth folder, How can I access those while being inside dockerfile of MyProject. I dont want to create the dockerfile outside MyProject

Ishaan Kanwar
  • 399
  • 1
  • 4
  • 16
  • When you build the Dockerfile, have it copy those items into the container – Mike L Nov 28 '22 at 05:01
  • For that to happen I need my dockerfile to be inside the `Main Project` directory, how will I do that by being inside `MyProject` ? – Ishaan Kanwar Nov 28 '22 at 05:10
  • 1
    Read this post https://stackoverflow.com/questions/24537340/docker-adding-a-file-from-a-parent-directory – Mike L Nov 28 '22 at 05:13

1 Answers1

0

Running the context from Main Project Do the following docker build -f MyProject/Dockerfile .. -f flag specifies the path to the dockerfile you want to build. Everything from root folder will be included in the context now

Ishaan Kanwar
  • 399
  • 1
  • 4
  • 16