bug: Faild to build a docker img
Describe the bug
on build a docker img from master branch
-
docker build -t logto-app i receive this error:
#0 79.24 packages/connectors/connector-oidc build: (!) Plugin node-resolve: preferring built-in module 'events' over local alternative at '/etc/logto/node_modules/.pnpm/[email protected]/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
#0 79.24 packages/connectors/connector-oidc build: (!) Plugin node-resolve: preferring built-in module 'buffer' over local alternative at '/etc/logto/node_modules/.pnpm/[email protected]/node_modules/buffer/index.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning
#0 79.24 packages/connectors/connector-oidc build: created lib in 3.6s
#0 79.26 packages/connectors/connector-oidc build: Done
#0 79.26 packages/schemas build$ pnpm generate && rm -rf lib/ && tsc -p tsconfig.build.json && pnpm build:alterations
#0 79.76 packages/schemas build: > @logto/[email protected] generate /etc/logto/packages/schemas
#0 79.76 packages/schemas build: > ./generate.sh
#0 79.77 packages/schemas build: sh: ./generate.sh: not found
#0 79.77 packages/schemas build: ELIFECYCLE Command failed.
#0 79.79 packages/schemas build: Failed
#0 79.79 undefined
#0 79.79 /etc/logto/packages/schemas:
#0 79.79 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL @logto/[email protected] build: pnpm generate && rm -rf lib/ && tsc -p tsconfig.build.json && pnpm build:alterations
#0 79.79 Exit status 1
Dockerfile:22
Expected behavior
generate a img docker from code
How to reproduce?
clone from master run command 'docker build -t name'
Context
- [ ] Logto Cloud
- [x ] Self-hosted
- [x ] Container (Docker image)
- [ ] Raw Node.js
Screenshots
Hi @brenobaroni , It seems that you are not building the image on a linux / macOS system. The development environment for Logto primarily focuses on macOS and Linux, and the support for the Windows environment might not be comprehensive at the moment. Currently, the recommended approach is to build your image based on Linux.
@brenobaroni could you provide the environment info?
- OS version
- Docker provider and version
I can build logto image on
- OS version - macOS 13.4
- Docker provider and version - OrbStack 0.15.1
Cause we run the command in container, the container environment is significant.
@tisonkun Windows 11 22H2
I cant run on wsl ubuntu 22 but i can run on the VPS server linux Ubuntu 22.04
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Seems to be a Windows compatibility issue to me. Since we are using .sh bash scripts and linux commands like rm -rf in our npm build command, this won't work like a miracle on Windows.
Please consider switching to macOS or Linux system when building docker image for now.