docker build . -t whatever_tag_you_want
So it seems the problem is Docker Compose since you can build the image without it. Have you tried without the verbose option? I guess that was the first you did before using it, but I still have to ask.
How long it takes to build the image without Docker Compose? Can it be some kind of timeout behind the scenes or is it cancelled almost immediately?
After further inspection, the image is built just fine when I run docker build .
in the frontend directory. I was confused because the other images that were build through docker-compose up --build
have names. I can run the unnamed container using docker run <container_id_here>
without any issue.
Yes, I have tried building without the verbose option, same problem occurs. I was hoping that the verbose option would give enough additional information to identify the source of the problem.
Without docker compose, it takes an EXTREMELY long time to build (up to 10 minutes). It’s not a timeout because the time it takes to build varies each time I try, and it always fails with the same message on the same step. It never cancels immediately.
autumnlindberg1:
It’s not a timeout because the time it takes to build varies each time I try
Than my second guess is a memory issue even though Docker Compose is practically just another client for the docker API, it could do something that uses more memory and crashes randomly depending on how much memory your machine uses at that time. There is nothing indicating that, but I don’t really know the reason so I’m guessing.
I am having the same issue on Windows suddenly too:
>>> docker-compose --verbose -f docker-compose.yml -f docker-compose-dev.yml up
[+] Running 1/1
! app Warning 2.2s
time="2023-10-20T15:45:35+02:00" level=debug msg="using default config store \"C:\\\\Users\\\\Oisin\\\\.docker\\\\buildx\""
[+] Building 1.4s (5/19) docker:default
=> [app internal] load .dockerignore 0.0s
=> => transferring context: 65B 0.0s
=> [app internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.16kB 0.0s
=> [app internal] load metadata for docker.io/library/python:3.9-buster 1.1s
=> CANCELED [app 1/15] FROM docker.io/library/python:3.9-buster@sha256:bae5b428ebf32d01a902718b0a58874cbf33d7a4b6a65b7cd7b21d48b0d2e2f1 0.1s
=> => resolve docker.io/library/python:3.9-buster@sha256:bae5b428ebf32d01a902718b0a58874cbf33d7a4b6a65b7cd7b21d48b0d2e2f1 0.1s
=> => sha256:bae5b428ebf32d01a902718b0a58874cbf33d7a4b6a65b7cd7b21d48b0d2e2f1 988B / 988B 0.0s
=> => sha256:191a38be55f72871359ebb522ab9621b872e67cac9b4b1834ccf1d2bce3a749d 2.01kB / 2.01kB 0.0s
=> => sha256:2646d4308aee325505bf575b2ecbafb8ef5088d6727585cb6e8215a1534b2472 7.51kB / 7.51kB 0.0s
=> CANCELED [app internal] load build context 0.1s
=> => transferring context: 4.60MB 0.1s
time="2023-10-20T15:45:35+02:00" level=debug msg="using default config store \"C:\\\\Users\\\\Oisin\\\\.docker\\\\buildx\""
time="2023-10-20T15:45:35+02:00" level=debug msg="serving grpc connection"
time="2023-10-20T15:45:35+02:00" level=debug msg="stopping session" span="load buildkit capabilities"
time="2023-10-20T15:45:35+02:00" level=debug msg="serving grpc connection"
time="2023-10-20T15:45:36+02:00" level=debug msg="stopping session"
failed to solve: Canceled: context canceled
I’m having this problem suddenly too. Windows 11, latest updates, running Docker v4.24.2.
$ docker-compose --verbose build
time="2023-10-24T11:55:49-04:00" level=debug msg="using default config store \"C:\\\\Users\\\\jziss\\\\.docker\\\\buildx\""
[+] Building 1.0s (6/12) docker:default
=> [app internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 636B 0.0s
=> [app internal] load metadata for docker.io/library/node:18.18-alpine 0.3s
=> [app internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [app 1/8] FROM docker.io/library/node:18.18-alpine@sha256:435dcad253bb5b7f347ebc69c8cc52de7c912eb7241098b920f2fc2d7843183d 0.0s
=> => resolve docker.io/library/node:18.18-alpine@sha256:435dcad253bb5b7f347ebc69c8cc52de7c912eb7241098b920f2fc2d7843183d 0.0s
=> CANCELED [app internal] load build context 0.6s
=> => transferring context: 60.01MB 0.5s
=> CANCELED [app 2/8] RUN apk add -u --no-cache chromium git 0.0s
time="2023-10-24T11:55:49-04:00" level=debug msg="using default config store \"C:\\\\Users\\\\jziss\\\\.docker\\\\buildx\""
time="2023-10-24T11:55:49-04:00" level=debug msg="serving grpc connection"
time="2023-10-24T11:55:49-04:00" level=debug msg="stopping session" span="load buildkit capabilities"
time="2023-10-24T11:55:49-04:00" level=debug msg="serving grpc connection"
time="2023-10-24T11:55:50-04:00" level=debug msg="stopping session"
failed to solve: Canceled: context canceled
I was able to solve this issue by checking out my project into another folder; after doing so, docker compose build worked.
Seems a permissions issue might be part of the problem?