Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
drwb opened this issue May 22, 2022 · 23 comments · May be fixed by #147
Open

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

drwb opened this issue May 22, 2022 · 23 comments · May be fixed by #147

Comments

@drwb
Copy link

drwb commented May 22, 2022

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
Copy link
Member

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

@drwb
Copy link
Author

drwb commented May 22, 2022

"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
Copy link
Member

"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
Copy link

@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
Copy link
Member

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
Copy link
Author

drwb commented May 31, 2022

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
Copy link
Author

drwb commented May 31, 2022

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
Copy link

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:
* Status: network stack not found, Code: 1

@GlitchWitch
Copy link
Contributor

GlitchWitch commented Jun 2, 2022

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
Copy link

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
Copy link
Member

related to #134
(linking for tracking)

Leopere pushed a commit to Leopere/calcom-docker that referenced this issue Aug 1, 2022
- added numerous environment variable changes such as implied defaults that can be overriden.
- skipped out on using git modules and just pull repo into build/launch step.  Adherance to license requires no repackaging and this solves this.
- cleaned up now unnecessary .env file.
- recycled environment section using yaml features.
- writing a few strings to config path to persist data between container starts that focus on cryptography and secrets.
- writing installed commit to the config path in case the end user needs to change the upstream git commit ID to a newer version for detection and automagic upgrades.
- added docker-compose.override.yml pattern to .gitignore to allow users to customize their local dev environment if they use docker-compose.yml
- wrote a dockerfile/container image which allows for uploading the base container to a private or public docker container registry without breaking the license rules.
- left .env ignore in case users wish to continue to use the old method.
- updated README.md to include updated simplified instructions.
- added start.sh script and wait-for-it.sh into the shell $PATH to allow for a potential future of allowing the main executable (node JS app) to run under a limited privilege user while still allowing the init scripts to be executed securely.
- added some input sanitation for certain critical variables.
- by default disabled/commented out the studio service as its not to typically be run to enforce better default deployment practices.  I would like to figure out what specific query to execute via the CLI instead of running a whole container to establish the first user in the end.
- wrote relatively unopinionated docker-compose.yml file to avoid causing problems for people trying to deploy this behind a reverse proxy for potential features such as TLS/HTTPS termination.
- upgraded compose version to latest '3.9' to be sure to enable most modern feature set.

Fixes calcom#87 by providing a working baseline with sober defaults.
Fixes calcom#88 by ensuring consistency across all containers Environment vars.
Fixes calcom#93 by allowing users to mount the application files within their IDE workspace, however, this will never solve for any times you will need to run yarn build steps.
Fixes calcom#99 by no longer using git submodules and just pulling a single commit depth copy of the ORIGIN repository on app bootstrap/first boot.
Fixes calcom#113 by no longer requiring build locally if the community maintainer of the Cal docker repository on GitHub will push this image to the hub.
Fixes calcom#121 by removing dependency on BuildKit this is done by simply deploying the app if its detected to be the first execution of this container be it due to no container persistence or a commit version upgrade from ORIGIN.
Fixes calcom#128 by removing dep on BuildKit
Fixes calcom#123 not replicatable and confirmed to be working in repository shipped state.
Fixes calcom#136 by building app on first launch from user define-able envvars which can be defined in numerous ways.
@Leopere Leopere linked a pull request Aug 1, 2022 that will close this issue
@krumware
Copy link
Member

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.

- name: Start database
run: |
docker compose up -d database
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: |
network=container:database
buildkitd-flags: |
--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
- name: Build and push image
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:latest
build-args: |
NEXT_PUBLIC_WEBAPP_URL=${{ env.NEXT_PUBLIC_WEBAPP_URL }}
NEXT_PUBLIC_LICENSE_CONSENT=${{ env.NEXT_PUBLIC_LICENSE_CONSENT }}
NEXT_PUBLIC_TELEMETRY_KEY=${{ env.NEXT_PUBLIC_TELEMETRY_KEY }}
DATABASE_URL=postgresql://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.DATABASE_HOST }}/${{ env.POSTGRES_DB }}

@joshavant
Copy link

joshavant commented Dec 22, 2022

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
Copy link
Member

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

@gitwittidbit
Copy link

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
Copy link

Razva commented Mar 5, 2023

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
Copy link

Razva commented Mar 5, 2023

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
Copy link
Member

krumware commented Mar 6, 2023

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
Copy link

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
Copy link

dm17 commented Apr 21, 2023

Supporting this would have saved a lot of time: docker/buildx#175

@dravagnolli
Copy link

dravagnolli commented Jun 26, 2023

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:
- database-data:/var/lib/postgresql/data/
env_file: .env
networks:
- mynetwork

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}
restart: always
networks:
- mynetwork
ports:
- 3000:3000
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
depends_on:
- database

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:
- mynetwork
ports:
- 5555:5555
env_file: .env
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DATABASE_HOST}/${POSTGRES_DB}
depends_on:
- database
command:
- npx
- prisma
- studio

END SECTION: Optional use of Prisma Studio.

@gitwittidbit
Copy link

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

Is there now an official solution to this?

Thanks!

@gogowitsch
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.