Hi, I need some guidance on how can I use docker w...
# general
b
Hi, I need some guidance on how can I use docker with my monorepo, preferably if someone has an example that would be great. I have a monorepo, structured into two major components
libraries
and
projects
, libraries have modules (packages) that are imported in projects. There are more than one library and more than one project. Each project has its own dockerfile and dependencies. I want to create a docker image for a project and push it to it's respective image repository. I can build a docker image by cd into project and running docker build but it fails if it has any dependencies on
libraries
(the libraries are installed as an editable install from
rquirements.txt
) . Ultimately I want to integrate image building step in cicd pipeline such that it builds only those images which have changed and rebuild all images if any of the shared library has changed.
w
Have you reviewed and tried out https://github.com/pantsbuild/example-docker ?
b
Thanks @wide-midnight-78598, I did. But couldn't figure out how to make it work for my end. I have a step in my
Dockerfile
,
COPY . /prj
but it fails with error
Copy code
Dockerfile has `COPY` instructions for source files that may not have been found in the Docker build context.

The following files were not found in the Docker build context:

  * .


15:38:10.20 [ERROR] 1 Exception encountered:
Even if this error is resolved somehow, I suspect it will fail again, because in my
requirements.txt
i have a line
-e ../../libs
, which would outside the build context of the image.