medic / cht-interoperability

CHT - eCHIS interoperability project
GNU Affero General Public License v3.0
2 stars 3 forks source link

ERROR: Service 'configurator' failed to build : COPY failed: forbidden path outside the build context: ../cht-config () #81

Closed ronna closed 1 year ago

ronna commented 1 year ago

Describe the bug When running for the first time I am getting error ERROR: Service 'configurator' failed to build : COPY failed: forbidden path outside the build context: ../cht-config ()

To Reproduce clone the https://github.com/medic/cht-interoperability run the ./startup.sh init command

Expected behavior docker images should be downloaded/build

Logs tux@T430s:~/cht-interoperability$ ./startup.sh init Building configurator Step 1/12 : FROM node:16-alpine ---> 8cf71856f96e Step 2/12 : RUN apk add g++ make py3-pip git curl chromium ---> Using cache ---> 7e485d0b1738 Step 3/12 : WORKDIR /scripts/configurator ---> Using cache ---> 87580573ba73 Step 4/12 : COPY ./configurator ./ ---> Using cache ---> 219afe8e5e0a Step 5/12 : RUN npm install ---> Using cache ---> c60c91ee6603 Step 6/12 : WORKDIR /scripts/cht-config ---> Using cache ---> 0b59f6545ef1 Step 7/12 : COPY ../cht-config ./ ERROR: Service 'configurator' failed to build : COPY failed: forbidden path outside the build context: ../cht-config ()

Screenshots

Environment

Additional context Add any other context about the problem here. What have you tried? Is there a workaround?

samuelimoisili commented 1 year ago

Hi @ronna, can you share your steps and screenshots, if possible? I tried replicating the error by following the recommended steps on WSL 20.04.6, but I couldn't replicate your error.

From the error message, it seems like there's an issue with the build context in the docker-compose.yml, but the current version seems to be pointing to the correct build context.

I also noticed you are running it in WSL. It is possible to run it on Windows directly by using the following commands in the root directory of the project:

docker compose -p chis-interop -f ./docker/docker-compose.yml -f ./docker/docker-compose.cht-core.yml -f ./docker/docker-compose.cht-couchdb.yml -f ./docker/docker-compose.mediator.yml up -d --build

PS: If it's convenient for you, please share this on the CHT forum and tag me. Thanks.

ronna commented 1 year ago

Hi @samuelimoisili

The issue has been resolved, I upgraded to compose v2 and that solved the issue