scalablescripts/python-microservices

Docker-compose up --build

ko5yak opened this issue · 0 comments

[+] Building 2.3s (6/10)
 => [queue internal] load build definition from Dockerfile
 => => transferring dockerfile: 198B
 => [queue internal] load metadata for docker.io/library/python:3.10
 => [queue auth] library/python:pull token for registry-1.docker.io
 => [queue internal] load .dockerignore
 => => transferring context: 63B
 => [queue 1/5] FROM docker.io/library/python:3.10@sha256:0be08c1c2c060efbcb8cf14d3d2c3e1e8d3f46ca7cb6937e7565b4658a85b790
 => CANCELED [queue internal] load build context
 => => transferring context: 273.44kB
failed to solve: Canceled: context canceled

From what I have gathered this issue was introduced in Docker Desktop 4.23 and newer versions. Thproposed solution on most forum discussions was to downgrade to Docker Desktop 4.22 However I believe there is a better solution out there. This issue for some reason arrises while transfering content from:

=> => transferring context: 63B
 => [queue 1/5] FROM docker.io/library/python:3.10 

perhaps the solution if to include a .dockerignore file and ignore a part of the python library. Or use a different python version like slim.

If anyone has enountered the same issue please LMK what was your solution.
I will try the proposed solution in the meantime.

And big thanks to Scalable Scripts for posting the tutoreal! Real G!

EDIT: after further diagnosing the issue the problem seems to be not with the docker itself, but with the permissions.
Running the docker-compose up from WSL terminal gave me a more detailed error message:

 => ERROR [queue internal] load build context                                                                      0.0s
 => => transferring context: 265B                                                                                  0.0s
[queue internal] load build context: failed to solve: error from sender: open /microservices_app/admin/.dbdata/#innodb_redo: permission denied

So the solution could be to change the permissions to the .dbdata repo using chmod 755, but I feel like that would be violating all the safety protocalls and exposing the db credentials to all users. I will look for a better solution

EDIT: I fixed this error by going into WSL and running the docker compose with sudo inside the project directory
sudo docker-compose up