calcom / docker

The Docker configuration for Cal.com is an effort powered by people within the community. Cal.com, Inc. does not provide official support for Docker, but we will accept fixes and documentation. Use at your own risk.
MIT License
689 stars 361 forks source link

docker compose build calcom fails with "network mode "stack" not supported by buildkit" #121

Open drwb opened 2 years ago

drwb commented 2 years ago

Following the instructions to build the container. docker compose build calcom fails with:

WARN[0000] The "NEXT_PUBLIC_TELEMETRY_KEY" variable is not set. Defaulting to a blank string. [+] Building 0.0s (0/0) network mode "stack" not supported by buildkit. You can define a custom network for your builder using the network driver-opt in buildx create.

DOCKER_BUILDKIT=0 docker compose build calcom then fails with:

$ husky install fatal: Not a git repository (or any of the parent directories): .git

Screenshot 2022-05-22 at 13 28 51

Which I assume is related to disabling buildkit.

Ubuntu 20.04.4 LTS

Client: Docker Engine - Community, Version: 20.10.16

docker-compose version 1.25.0, build unknown

Docker Compose version v2.5.0

Any pointers appreciated.

krumware commented 2 years ago

Those are typically warns and do not fail the build. Is there more log content available?

drwb commented 2 years ago

"network mode "stack" not supported by buildkit. You can define a custom network for your builder using the network driver-opt in buildx create." is terminal and exits the build process

Screenshot 2022-05-22 at 16 28 25

.

But you're right that DOCKER_BUILDKIT=0 docker compose build calcom continues past the stage I originally posted if left for long enough.

krumware commented 2 years ago

"network mode "stack" not supported by buildkit" is a separate issue I'm working around. The husky error is not related to buildkit, it is because we're note copying .git into the container (intentionally). but that error has not exited the container build in the past.

Can you give the output of the DOCKER_BUILDKIT=0 docker compose build calcom (or the ending portion which demonstrates it's failure)?

PhilippFr commented 2 years ago

@krumware I'm having the same issue with the $ husky install fatal: Not a git repository (or any of the parent directories): .git

here is the complete build output:

$ DOCKER_BUILDKIT=0 docker compose build calcom
WARN[0000] The "NEXT_PUBLIC_TELEMETRY_KEY" variable is not set. Defaulting to a blank string.
Sending build context to Docker daemon  38.19MB
Step 1/25 : FROM node:14 as builder
 ---> d0c8d2556876
Step 2/25 : WORKDIR /calcom
 ---> Using cache
 ---> 5995a8840cb8
Step 3/25 : ARG NEXT_PUBLIC_WEBAPP_URL
 ---> Using cache
 ---> 2a9a74ee0ee9
Step 4/25 : ARG NEXT_PUBLIC_APP_URL
 ---> Using cache
 ---> 8a5e138697e3
Step 5/25 : ARG NEXT_PUBLIC_LICENSE_CONSENT
 ---> Using cache
 ---> 5e24f4f7374a
Step 6/25 : ARG NEXT_PUBLIC_TELEMETRY_KEY
 ---> Using cache
 ---> 0853178d0567
Step 7/25 : ARG DATABASE_URL
 ---> Using cache
 ---> d64e7968ab2c
Step 8/25 : ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL     NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL     NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT     NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY     DATABASE_URL=$DATABASE_URL
 ---> Using cache
 ---> a57995eb476c
Step 9/25 : COPY calcom/package.json calcom/yarn.lock calcom/turbo.json ./
 ---> Using cache
 ---> 1fc328b47937
Step 10/25 : COPY calcom/apps/web ./apps/web
 ---> Using cache
 ---> 3d1e2d6eb375
Step 11/25 : COPY calcom/packages ./packages
 ---> Using cache
 ---> c61de3afe055
Step 12/25 : RUN yarn install --frozen-lockfile
 ---> Running in 687c0ad0549b
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "@types/node@14.17.6" is incompatible with requested version "@types/node@^12.12.6"
warning Resolution field "@types/node@14.17.6" is incompatible with requested version "@types/node@^12.12.6"
warning Resolution field "@types/node@14.17.6" is incompatible with requested version "@types/node@^12.12.6"
warning Resolution field "@types/node@14.17.6" is incompatible with requested version "@types/node@16.9.1"
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > @calcom/embed-react@1.0.6" has unmet peer dependency "react@^18.1.0".
warning " > @calcom/embed-react@1.0.6" has unmet peer dependency "react-dom@^18.1.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @next-auth/prisma-adapter@1.0.3" has unmet peer dependency "@prisma/client@>=2.26.0 || >=3".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-avatar@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-collapsible@0.1.6" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog@0.1.7" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog@0.1.7" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dropdown-menu@0.1.6" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dropdown-menu@0.1.6" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-id@0.1.5" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-radio-group@0.1.5" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-slider@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-switch@0.1.5" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-tooltip@0.1.7" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-tooltip@0.1.7" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @vercel/edge-functions-ui@0.2.1" has incorrect peer dependency "react@^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @vercel/edge-functions-ui@0.2.1" has incorrect peer dependency "react-dom@^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-live-chat-loader@2.7.3" has incorrect peer dependency "react@^16.14.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-multi-email@0.5.3" has incorrect peer dependency "react@^16.3.2".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-multi-email@0.5.3" has incorrect peer dependency "react-dom@^16.3.2".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-virtualized-auto-sizer@1.0.6" has incorrect peer dependency "react@^15.3.0 || ^16.0.0-alpha || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-virtualized-auto-sizer@1.0.6" has incorrect peer dependency "react-dom@^15.3.0 || ^16.0.0-alpha || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/config > eslint-config-next@12.1.6" has unmet peer dependency "next@>=10.2.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-avatar > @radix-ui/react-context@0.1.1" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-avatar > @radix-ui/react-primitive@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-avatar > @radix-ui/react-use-callback-ref@0.1.0" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-avatar > @radix-ui/react-use-layout-effect@0.1.0" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-collapsible > @radix-ui/react-compose-refs@0.1.0" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-collapsible > @radix-ui/react-use-controllable-state@0.1.0" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > @radix-ui/react-dismissable-layer@0.1.5" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > @radix-ui/react-focus-guards@0.1.0" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > @radix-ui/react-focus-scope@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > @radix-ui/react-portal@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > @radix-ui/react-portal@0.1.4" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > @radix-ui/react-slot@0.1.2" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dropdown-menu > @radix-ui/react-menu@0.1.6" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dropdown-menu > @radix-ui/react-menu@0.1.6" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-radio-group > @radix-ui/react-label@0.1.5" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-radio-group > @radix-ui/react-roving-focus@0.1.5" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-radio-group > @radix-ui/react-use-previous@0.1.1" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-radio-group > @radix-ui/react-use-size@0.1.1" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-slider > @radix-ui/react-collection@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-slider > @radix-ui/react-use-direction@0.1.0" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-tooltip > @radix-ui/react-popper@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-tooltip > @radix-ui/react-use-escape-keydown@0.1.0" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-tooltip > @radix-ui/react-use-rect@0.1.1" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-tooltip > @radix-ui/react-visually-hidden@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-hot-toast > goober@2.1.8" has unmet peer dependency "csstype@^3.0.10".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-timezone-select > react-select@5.2.2" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-timezone-select > react-select@5.2.2" has incorrect peer dependency "react-dom@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > @radix-ui/react-dismissable-layer > @radix-ui/react-use-body-pointer-events@0.1.1" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > react-remove-scroll > react-remove-scroll-bar@2.2.0" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > react-remove-scroll > react-style-singleton@2.1.1" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > react-remove-scroll > use-callback-ref@1.2.5" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-dialog > react-remove-scroll > use-sidecar@1.0.5" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-tooltip > @radix-ui/react-popper > @radix-ui/react-arrow@0.1.4" has incorrect peer dependency "react@^16.8 || ^17.0".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
[5/5] Building fresh packages...
$ turbo run post-install
 WARNING  cannot find a .git folder. Falling back to manual file hashing (which may be slower). If you are running this build in a pruned directory, you can ignore this message. Otherwise, please initialize a git repository in the root of your monorepo
• Packages in scope: @calcom/app-store, @calcom/applecalendar, @calcom/caldavcalendar, @calcom/config, @calcom/core, @calcom/dailyvideo, @calcom/ee, @calcom/embed-core, @calcom/embed-react, @calcom/embed-snippet, @calcom/example-app, @calcom/giphy, @calcom/googlecalendar, @calcom/googlevideo, @calcom/hubspotothercalendar, @calcom/huddle01video, @calcom/jitsivideo, @calcom/lib, @calcom/metamask, @calcom/office365calendar, @calcom/office365video, @calcom/prisma, @calcom/slackmessaging, @calcom/spacebooking, @calcom/stripe, @calcom/stripepayment, @calcom/tandemvideo, @calcom/tsconfig, @calcom/types, @calcom/ui, @calcom/vital, @calcom/web, @calcom/zapier, @calcom/zoomvideo, WipeMyCal
• Running post-install in 35 packages
@calcom/prisma:post-install: cache miss, executing e6470129106f2918
@calcom/prisma:post-install: yarn run v1.22.19
@calcom/prisma:post-install: $ yarn generate-schemas
@calcom/prisma:post-install: $ prisma generate && prisma format
@calcom/prisma:post-install: Prisma schema loaded from schema.prisma
@calcom/prisma:post-install:
@calcom/prisma:post-install: ✔ Generated Prisma Client (3.14.0 | library) to ./../../node_modules/@prisma/client in 1.07s
@calcom/prisma:post-install:
@calcom/prisma:post-install: ✔ Generated Zod Schemas (0.5.4) to ./zod in 1.16s
@calcom/prisma:post-install: You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
@calcom/prisma:post-install: ```
@calcom/prisma:post-install: import { PrismaClient } from '@prisma/client'
@calcom/prisma:post-install: const prisma = new PrismaClient()
@calcom/prisma:post-install: ```
@calcom/prisma:post-install: Prisma schema loaded from schema.prisma
@calcom/prisma:post-install: Formatted /calcom/packages/prisma/schema.prisma in 193ms 🚀
@calcom/prisma:post-install: Done in 12.22s.

 Tasks:    1 successful, 1 total
Cached:    0 cached, 1 total
  Time:    13.303s

$ husky install
fatal: Not a git repository (or any of the parent directories): .git
Done in 258.24s.

Could it be due to these sub-modules 404'ing, why is that btw? https://github.com/calcom/website.git https://github.com/calcom/console.git https://github.com/calcom/api.git

krumware commented 2 years ago

I'm sorry y'all are having that error. This is a tough one to unpack remotely. This error has existed in the build for some time, and while it says fatal in the logs, that doesn't necessarily mean that the docker build was fatal. What docker runtime are you using for building the image? (it may just be docker desktop, but there are many available now). Any extra environmental info you can provide to help track this down would be awesome.

Here is the same error message in the github actions build where the container build succeeds (the relevant section of the logs):

...
...
@calcom/prisma:post-install: Prisma schema loaded from schema.prisma
@calcom/prisma:post-install: Formatted /calcom/packages/prisma/schema.prisma in 141ms 🚀
@calcom/prisma:post-install: Done in 5.17s.

 Tasks:    1 successful, 1 total
Cached:    0 cached, 1 total
  Time:    6.319s 

$ husky install
fatal: Not a git repository (or any of the parent directories): .git
Done in 84.48s.
Removing intermediate container cd6e2a62af4f
 ---> 04132ef28d1e
Step 13/25 : RUN yarn build
 ---> Running in f041d930c7df
yarn run v1.22.17
...
...

Regarding the 404s, those are private repositories that are not yet available for public consumption. They are not required for the build. You shouldn't notice them unless you followed the old instructions and tried to update the calcom submodule recursively.

drwb commented 2 years ago

With me, I was simply not waiting long enough. It presented the fatal: Not a git repository (or any of the parent directories): .git error but would not crash back to prompt and, leaving it for a long time, it eventually continued and built successfully.

drwb commented 2 years ago

DOCKER_BUILDKIT=0 docker compose build calcom

DOCKER_BUILDKIT=0 docker compose build calcom then builds successfully.

I do then end up stuck with #122 but that's a separate issue.

Frank-Wiebeler commented 2 years ago

with DOCKER_BUILDKIT=0 I was able to start the build but for me it crashes at Step 12 with this message: 1 error occurred:

GlitchWitch commented 2 years ago

I'm running into the same issues noted by @drwb and @Frank-Wiebeler on a fresh and up to date install of Ubuntu 22.04 server using the latest docker install.

$ docker compose up -d database
[+] Running 1/1
 ⠿ Container calcom-docker-database-1  Started                                                      0.4s

$ docker compose build calcom
[+] Building 0.0s (0/0)                                                                                  
network mode "stack" not supported by buildkit. You can define a custom network for your builder using the network driver-opt in buildx create.

$ DOCKER_BUILDKIT=0 docker compose build calcom

Sending build context to Docker daemon  38.18MB
Step 1/25 : FROM node:14 as builder
[...]
Step 12/25 : RUN yarn install --frozen-lockfile
 ---> Running in 1bf32f66b12b
1 error occurred:
    * Status: network stack not found, Code: 1
$ docker compose up -d database
[+] Running 1/1
 ⠿ Container calcom-docker-database-1  Started                                                      0.4s

$ docker compose up -d
[+] Building 0.0s (0/0)                                                                                                                                                                                             
network mode "stack" not supported by buildkit. You can define a custom network for your builder using the network driver-opt in buildx create.

$ DOCKER_BUILDKIT=0 docker compose up -d

Sending build context to Docker daemon  38.18MB
[...]
Step 12/25 : RUN yarn install --frozen-lockfile
 ---> Using cache
 ---> f26985ab217f
Step 13/25 : RUN yarn build
 ---> Running in 31cb262ed1d8
1 error occurred:
    * Status: network stack not found, Code: 1
gianlucagilardi commented 2 years ago

I'm running into the same issues noted by @drwb and @Frank-Wiebeler on a fresh and up to date install of Ubuntu 22.04 server using the latest docker install.

$ docker compose up -d database
[+] Running 1/1
 ⠿ Container calcom-docker-database-1  Started                                                      0.4s

$ docker compose build calcom
[+] Building 0.0s (0/0)                                                                                  
network mode "stack" not supported by buildkit. You can define a custom network for your builder using the network driver-opt in buildx create.

$ DOCKER_BUILDKIT=0 docker compose build calcom

Sending build context to Docker daemon  38.18MB
Step 1/25 : FROM node:14 as builder
[...]
Step 12/25 : RUN yarn install --frozen-lockfile
 ---> Running in 1bf32f66b12b
1 error occurred:
  * Status: network stack not found, Code: 1
$ docker compose up -d database
[+] Running 1/1
 ⠿ Container calcom-docker-database-1  Started                                                      0.4s

$ docker compose up -d
[+] Building 0.0s (0/0)                                                                                                                                                                                             
network mode "stack" not supported by buildkit. You can define a custom network for your builder using the network driver-opt in buildx create.

$ DOCKER_BUILDKIT=0 docker compose up -d

Sending build context to Docker daemon  38.18MB
[...]
Step 12/25 : RUN yarn install --frozen-lockfile
 ---> Using cache
 ---> f26985ab217f
Step 13/25 : RUN yarn build
 ---> Running in 31cb262ed1d8
1 error occurred:
  * Status: network stack not found, Code: 1

I have read in #129 that you were able to solve the issue: how did you do that? I am stuck at the network stack not found error :(

krumware commented 2 years ago

related to #134 (linking for tracking)

krumware commented 2 years ago

For folks landing in this issue, docker-compose is not the only method of building the image. It deserves a written guide, but in the meantime, more advanced users can follow this example to build the container directly, without docker-compose, and by networking directly with a running container.

In our GHA, we stand up the database service and its container, by running docker compose up -d database (specifying database for compose to select and run only our configuration for the database). We don't have to start the database service using compose, it's just convenient. Afterwards you can network buildx to the container by specifying container:database as the network. https://github.com/calcom/docker/blob/9f2791858d39343f47d819e9115eb336efa7e973/.github/workflows/docker-build-push-dockerhub.yml#L69-L94

joshavant commented 1 year ago

Cross-posted from Slack:

OK, after spending a few hours on it, i think i figured out a fix:

  1. Currently, internal creation of DATABASE_URL value from the env for the prisma build step seems to be broken. What DOES work is passing in this value via the command line, like: DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://postgres:postgres@host:5432/database calcom
  2. The LAN IP address of the database container needs to be used at the command line, not the generic database:5432 addressing. That is, before calling the above command, the user needs to docker-compose up database --detach, docker exec -it database bash, inside the database container get the LAN IP address via hostname -I, and then use that value as the appropriate URL host address within the command above. Example: DOCKER_BUILDKIT=0 docker compose build --build-arg DATABASE_URL=postgresql://postgres:postgres@172.24.0.2:5432/database calcom
krumware commented 1 year ago

You really shouldn't have to that extra work. Can you share what docker runtime/tools and their versions you're using?

gitwittidbit commented 1 year ago

My setup was working until I recently tried to update it (due to hoping that a certain has been ironed out in a newer version).

Now I am stuck at "not supported by buildkit".

Has anybody succeeded in applying the solution above? I don't even know where to start...

Razva commented 1 year ago

Same here, basically stuck at this:

network mode "stack" not supported by buildkit - you can define a custom network for your builder using the network driver-opt in buildx create

When doing DOCKER_BUILDKIT=0 docker compose build calcom I'm getting this:

Step 13/33 : RUN yarn global add turbo &&     yarn config set network-timeout 1000000000 -g &&     turbo prune --scope=@calcom/web --docker &&     yarn install
 ---> Running in 4488a2de3d12
1 error occurred:
        * Status: network stack not found, Code: 1

Any hints?

Razva commented 1 year ago

For folks landing in this issue, docker-compose is not the only method of building the image. It deserves a written guide, but in the meantime, more advanced users can follow this example to build the container directly, without docker-compose, and by networking directly with a running container.

In our GHA, we stand up the database service and its container, by running docker compose up -d database (specifying database for compose to select and run only our configuration for the database). We don't have to start the database service using compose, it's just convenient. Afterwards you can network buildx to the container by specifying container:database as the network.

Can you please make a more in-depth explanation, for those who are not that advanced? Thank you

krumware commented 1 year ago

The error reports that your network named stack hasn't been created yet. Run docker compose up -d database, which will create the network if it doesn't exist. Then run your DOCKER_BUILDKIT=0 docker compose build calcom command again.

djiworks commented 1 year ago

For me I had to comment network: stack line to fix this error. But in my case I use a remote database not the one in docker compose file

  calcom:
    image: calcom.docker.scarf.sh/calcom/cal.com
    build:
      context: .
      dockerfile: Dockerfile
      args:
        NEXT_PUBLIC_WEBAPP_URL: ${NEXT_PUBLIC_WEBAPP_URL}
        NEXT_PUBLIC_LICENSE_CONSENT: ${NEXT_PUBLIC_LICENSE_CONSENT}
        CALCOM_TELEMETRY_DISABLED: ${CALCOM_TELEMETRY_DISABLED}
        NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
        CALENDSO_ENCRYPTION_KEY: ${CALENDSO_ENCRYPTION_KEY}
        DATABASE_URL: ${DATABASE_URL}
#      network: stack
    restart: always
    networks:
      - stack
    ports:
      - 3000:3000
    env_file: .env
    environment:
      - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
    depends_on:
      - database
dm17 commented 1 year ago

Supporting this would have saved a lot of time: https://github.com/docker/buildx/issues/175

dravagnolli commented 1 year ago

I solved this problem by editing the calcom-docker/docker-compose.yaml file with the following configuration.

version: '3.8'

volumes: database-data:

networks: mynetwork: driver: bridge

services: database: container_name: database image: postgres restart: always volumes:

Optional use of Prisma Studio. In production, comment out or remove the section below to prevent unwanted access to your database.

studio: image: calcom.docker.scarf.sh/calcom/cal.com restart: always networks:

gitwittidbit commented 6 months ago

Decided to give it another try, but getting stuck at the same error again.

Is there now an official solution to this?

Thanks!

gogowitsch commented 5 months ago

@dravagnolli You can use several backticks on a separate before and after your posted YAML to disable Markdown rules. See https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code for an example.

neuhaus commented 2 weeks ago

You shouldn't notice them unless you followed the old instructions and tried to update the calcom submodule recursively.

Can you please clarify what the old instructions are and which ones i should follow?

I see the README that's included in the https://github.com/calcom/docker.git repository and then there's the documentation at https://cal.com/docs/self-hosting/docker

Which instructions are the "right" ones?