I have a MERN stack app that I am working on. Whenever I run docker-compose --verbose up --build
, it builds an image for Mongo and the backend just fine. However, it hangs up on the frontend with the error CANCELED [frontend internal] load build context
.
The full message on the console is this:
PS C:\Users\autum\OneDrive\CODE\WEB\Vidly> docker-compose --verbose up --build
time="2023-10-07T11:10:49-07:00" level=debug msg="using default config store \"C:\\\\Users\\\\autum\\\\.docker\\\\buildx\""
[+] Building 2.8s (12/12) docker:default
[+] Building 4.7s (15/18) docker:default
=> [backend internal] load build definition from dockerfile 0.1s
=> => transferring dockerfile: 598B 0.0s
=> [backend internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [frontend internal] load metadata for docker.io/library/node:14.16.0-alpine3.13 1.6s
=> [backend auth] library/node:pull token for registry-1.docker.io 0.0s
=> [frontend 1/6] FROM docker.io/library/node:14.16.0-alpine3.13@sha256:2c51dc462a02f15621e7486774d36d048a27225d581374b002b8477a79a59b4b 0.0s
=> [backend internal] load build context 1.3s
=> => transferring context: 192.43kB 1.3s
=> CACHED [backend 2/6] RUN addgroup app && adduser -S -G app app 0.0s
=> CACHED [backend 3/6] WORKDIR /app 0.0s
=> CACHED [backend 4/6] COPY package*.json ./ 0.0s
=> CACHED [backend 5/6] RUN npm install 0.0s
=> CACHED [backend 6/6] COPY . . 0.0s
=> [backend] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:6b403109fcae4c4a19181b7375a22fd1f422ff00cd2f7d9fb5016cd7e71cc505 0.0s
=> => naming to docker.io/library/vidly-backend 0.0s
=> [frontend internal] load build definition from dockerfile 0.4s
=> => transferring dockerfile: 659B 0.0s
=> [frontend internal] load .dockerignore 0.3s
=> => transferring context: 2B 0.0s
=> CANCELED [frontend internal] load build context 0.5s
=> => transferring context: 1.85MB 0.4s
time="2023-10-07T11:10:49-07:00" level=debug msg="using default config store \"C:\\\\Users\\\\autum\\\\.docker\\\\buildx\""
time="2023-10-07T11:10:51-07:00" level=debug msg="serving grpc connection"
time="2023-10-07T11:10:51-07:00" level=debug msg="stopping session" span="load buildkit capabilities"
time="2023-10-07T11:10:52-07:00" level=debug msg="serving grpc connection"
time="2023-10-07T11:10:55-07:00" level=debug msg="stopping session"
time="2023-10-07T11:10:55-07:00" level=debug msg="using default config store \"C:\\\\Users\\\\autum\\\\.docker\\\\buildx\""
time="2023-10-07T11:10:55-07:00" level=debug msg="stopping session" span="load buildkit capabilities"
time="2023-10-07T11:10:55-07:00" level=debug msg="serving grpc connection"
time="2023-10-07T11:10:55-07:00" level=debug msg="serving grpc connection"
time="2023-10-07T11:10:56-07:00" level=debug msg="stopping session"
failed to solve: Canceled: context canceled
Itās worth noting that I pushed the whole project to a git repository so that someone else could try it on another computer. It builds and runs just fine on a mac, and it builds and runs just fine on my Windows desktop PC. It only seems to be having this problem on my Windows laptop (where it has worked before)
I also vaguely remember accidentally typing docker images trim
or something like that because I forgot that it was prune
and not trim
for dangling images.
It also seems to build without errors using docker build .
inside the frontend folder, but in the images list it shows up as dangling (repository and tag are set to <none>
)
What I have tried:
- deleting and reinstalling docker engine
- switching contexts (I have tried default, desktop-linux, and desktop-windows)
- deleting all images and volumes and building again
- clean/purge data in docker desktop debug options
- reset to factory defaults in docker desktop debug options
- restarting my PC
- restarting docker desktop
Any help or suggestions are welcome! I really enjoy working on my laptop so it would be great if the fix wasnāt āwork on your desktop since it works thereā.