Hey, guys! I’m having troubles building calcom doc...
# docker
s
Hey, guys! I’m having troubles building calcom docker container. I’m following these steps here: https://github.com/calcom/docker#advanced-users-build-and-run-calcom using external database (DATABASE_URL is set in the .env file).
DOCKER_BUILDKIT=0 docker compose build calcom
returns this error:
Copy code
➤ YN0013: │ @aws-sdk/middleware-endpoint@npm:3.272.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @aws-sdk/middleware-host-header@npm:3.272.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @aws-sdk/is-array-buffer@npm:3.201.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @aws-sdk/middleware-content-length@npm:3.272.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @aws-sdk/middleware-endpoint@npm:3.272.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @aws-sdk/middleware-host-header@npm:3.272.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ @aws-sdk/middleware-logger@npm:3.272.0 can't be found in the cache and will be fetched from the remote registry
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
The command '/bin/sh -c yarn config set httpTimeout 1200000 &&     npx turbo prune --scope=@calcom/web --docker &&     yarn install &&     yarn db-deploy &&     yarn --cwd packages/prisma seed-app-store' returned a non-zero code: 1
I’ve tried running
yarn install
in the root folder and in the
./calcom
folder - same result. I’m on Mac (Ventura 13.4.1), using Node v18.16.1, Docker v.4.19.0 Any idea how to fix it?
My only progress so far is I found
yarn db-deploy
causes the error. Could it be related with external database instead of the local one?
Further investigation shows the previous step (
yarn install
) is not properly installing the packages (although it ends with code 0). I’ve tried to open the containers terminal and install packages from there, but it silently stops on the “Fetch step”:
c
I've also struggled getting this to work but had more luck using buildx, you could try running something like the following which I think worked for me 1. Create your buildx builder
docker buildx create --name builder-ae930490-a5b1-451f-809d-e3e509cd48f7 --driver docker-container --driver-opt network=container:database --buildkitd-flags '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host' --use
2. Do the build
docker buildx build --build-arg NEXT_PUBLIC_WEBAPP_URL=<http://localhost:3000> --build-arg NEXT_PUBLIC_LICENSE_CONSENT= --build-arg NEXT_PUBLIC_TELEMETRY_KEY= --build-arg DATABASE_URL=<postgresql://unicorn_user:magical_password@localhost:5432/calendso> —build-arg GOOGLE_API_CREDENTIALS={} --file ./Dockerfile --platform linux/amd64
Might need to fiddle slightly with what i've pasted there but it should work
s
Thanks for your reply! It didn’t worked for me though 🙂 (I’d adjusted the build args, of course). Could you briefly point out what might be causing this issue, and what’s the idea behind this solution? I could google it then, and maybe adapt to my situation.
c
is your mac an ARM machine?
s
Nope, 2,3 GHz Quad-Core Intel Core i7
Could it be due to resource limitations? The behavior is very similar to what is described here: https://github.com/yarnpkg/berry/issues/3996 Although, I’ve tried to put docker memory limit to 2GB and it didn’t helped
c
ah it definitely could, at least for the build
the build needs at least 4gb RAM to build
s
Ok, let me try with 8GB limit. Do you know if changing docker compose to version 2.4 is okay? Setting resources is much easier with version 2.x
Hm, setting limit to 8GB didn’t helped
Apparently, there’s something’s wrong with my Docker. We’d just tried doing the same installation on my colleague’s machine, and it went well. Thanks for your help! 🙂
I’ve downgraded my Docker to v.4.18.0 and it works! So the problem was with the latest Docker v.4.21.0
c
oh interesting, good to know!
sometimes docker just needs a good kick with
docker system prune --all --volumes
as well