Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Service 'css' failed to build : COPY failed: forbidden path outside the build context: #11

Closed
cjonesyyc opened this issue Jan 12, 2022 · 4 comments

Comments

@cjonesyyc
Copy link

Hi,

Great project, should save a lot of time! I'm trying to run on Ubuntu 20.04.3 LTS and I get the following error:

Step 10/12 : COPY --chown=node:node ../ ../
ERROR: Service 'css' failed to build : COPY failed: forbidden path outside the build context: ../ ()

Commenting out line 23 of the Dockerfile allows the build to finish

COPY --chown=node:node ../ ../

Perhaps I'm doing something wrong. Django starts up and everything looks good but I'm unsure the impact. Using WSL2 on Windows with the same OS works OK.

Thanks!

@nickjj
Copy link
Owner

nickjj commented Jan 12, 2022

Hi,

Are you using Docker Desktop or did you install Docker straight up within your Ubuntu WSL 2 instance?

That error usually happens when Docker's buildkit isn't enabled but Docker Desktop should enable it by default. It's been available from Docker for years but I don't think it's enabled by default with native Linux.

If you run DOCKER_BUILDKIT=1 docker-compose build does that fix it?

If so and you're not using Docker Desktop you can goto /etc/docker/daemon.json and add { "features": { "buildkit": true } } then restart the Docker daemon. That'll always enable buildkit without needing to supply the env variable.

@cjonesyyc
Copy link
Author

Hi,

In Windows where it was working it was with Docker Desktop.

On the Ubuntu 20.04 VM I tried setting the env variable and it didn't work, seems like buildkit was missing in the install. I re-created the VM and install docker/docker-compose following official docker instructions and now that env variable works.

Thank you!

@nickjj
Copy link
Owner

nickjj commented Jan 13, 2022

No problem.

Did you enable it in the json config to avoid needing to set the env var every time?

@cjonesyyc
Copy link
Author

Just tried that now, the file didn't exist on my machine so I created it and put the mentioned line and it's working without setting it every time. Much appreciated, thanks for the support and great project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants