I have a folder structure where our project uses common projects but those projects do not live under the project that has the dockerfile in it. How can I access the projects outside the dockerfile project to get to those?
If you use docker build ., the build context is the current directory. As such it is the correct behavior that you are not allowed to access files in a parent/sibling folder. It would be a security issue if image builds could freely access any files from the host file system.
You could use COPY folder1/file1 /container/path/file1 if you run docker build --file folder2/Dockerfile . in the parent folder to build the image. The build context would be the parent folder, and folder1/folder1 would be within the build context.