docker icon indicating copy to clipboard operation
docker copied to clipboard

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

Open drwb opened this issue 2 years ago • 23 comments

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.

drwb avatar May 22 '22 12:05 drwb

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

krumware avatar May 22 '22 14:05 krumware

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

drwb avatar May 22 '22 15:05 drwb

"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)?

krumware avatar May 25 '22 15:05 krumware

@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/[email protected]" is incompatible with requested version "@types/node@^12.12.6"
warning Resolution field "@types/[email protected]" is incompatible with requested version "@types/node@^12.12.6"
warning Resolution field "@types/[email protected]" is incompatible with requested version "@types/node@^12.12.6"
warning Resolution field "@types/[email protected]" is incompatible with requested version "@types/[email protected]"
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > @calcom/[email protected]" has unmet peer dependency "react@^18.1.0".
warning " > @calcom/[email protected]" has unmet peer dependency "react-dom@^18.1.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @next-auth/[email protected]" has unmet peer dependency "@prisma/client@>=2.26.0 || >=3".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/[email protected]" has incorrect peer dependency "react-dom@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @vercel/[email protected]" has incorrect peer dependency "react@^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @vercel/[email protected]" has incorrect peer dependency "react-dom@^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > [email protected]" has incorrect peer dependency "react@^16.14.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > [email protected]" has incorrect peer dependency "react@^16.3.2".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > [email protected]" has incorrect peer dependency "react-dom@^16.3.2".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > [email protected]" 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 > [email protected]" 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 > [email protected]" has unmet peer dependency "next@>=10.2.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > @radix-ui/react-avatar > @radix-ui/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" 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/[email protected]" has incorrect peer dependency "react@^16.8 || ^17.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-hot-toast > [email protected]" has unmet peer dependency "csstype@^3.0.10".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-timezone-select > [email protected]" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
warning "workspace-aggregator-fb72e91e-ec8e-4ed2-b9cd-254a211b7e20 > @calcom/web > react-timezone-select > [email protected]" 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/[email protected]" 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 > [email protected]" 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 > [email protected]" 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 > [email protected]" 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 > [email protected]" 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/[email protected]" 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

PhilippFr avatar May 31 '22 15:05 PhilippFr

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.

krumware avatar May 31 '22 16:05 krumware

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 avatar May 31 '22 16:05 drwb

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.

drwb avatar May 31 '22 16:05 drwb

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

Frank-Wiebeler avatar Jun 01 '22 12:06 Frank-Wiebeler

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

GlitchWitch avatar Jun 02 '22 06:06 GlitchWitch

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 :(

gianlucagilardi avatar Jun 24 '22 14:06 gianlucagilardi

related to #134 (linking for tracking)

krumware avatar Jul 18 '22 15:07 krumware

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

krumware avatar Sep 27 '22 13:09 krumware

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:[email protected]:5432/database calcom

joshavant avatar Dec 22 '22 05:12 joshavant

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

krumware avatar Dec 22 '22 10:12 krumware

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

gitwittidbit avatar Jan 13 '23 19:01 gitwittidbit

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 avatar Mar 05 '23 09:03 Razva

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

Razva avatar Mar 05 '23 09:03 Razva

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.

krumware avatar Mar 06 '23 14:03 krumware

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

djiworks avatar Mar 20 '23 07:03 djiworks

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

dm17 avatar Apr 21 '23 13:04 dm17

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.

dravagnolli avatar Jun 26 '23 13:06 dravagnolli

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

Is there now an official solution to this?

Thanks!

gitwittidbit avatar Apr 01 '24 08:04 gitwittidbit