Failed to build Docker image locally using the Dockerfile in the source code #6270
-
What happened?when I
>[email protected] backend
> cross-env NODE_ENV=production node api/server/index.js
sh: cross-env: not found
[36mINFO�[0m[2025-03-10T11:09:54Z] Initializing snapshotter ...
�[36mINFO�[0m[2025-03-10T11:09:54Z] Taking snapshot of full filesystem...
�[36mINFO�[0m[2025-03-10T11:09:54Z] Cmd: /bin/sh
�[36mINFO�[0m[2025-03-10T11:09:55Z] Args: [-c export HTTP_PROXY=${__PROXY__} ; export HTTPS_PROXY=${__PROXY__} ; export NO_PROXY=${__NOPROXY__} ; sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories ; apk add --no-cache curl]
�[36mINFO�[0m[2025-03-10T11:09:55Z] Running: [/bin/sh -c export HTTP_PROXY=${__PROXY__} ; export HTTPS_PROXY=${__PROXY__} ; export NO_PROXY=${__NOPROXY__} ; sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories ; apk add --no-cache curl]
fetch https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.21/main/x86_64/APKINDEX.tar.gz
fetch https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.21/community/x86_64/APKINDEX.tar.gz
(1/9) Installing brotli-libs (1.1.0-r2)
(2/9) Installing c-ares (1.34.3-r0)
(3/9) Installing libunistring (1.2-r0)
(4/9) Installing libidn2 (2.3.7-r0)
(5/9) Installing nghttp2-libs (1.64.0-r0)
(6/9) Installing libpsl (0.21.5-r3)
(7/9) Installing zstd-libs (1.5.6-r2)
(8/9) Installing libcurl (8.12.1-r0)
(9/9) Installing curl (8.12.1-r0)
Executing busybox-1.37.0-r12.trigger
OK: 14 MiB in 26 packages
�[36mINFO�[0m[2025-03-10T11:09:58Z] Taking snapshot of full filesystem...
�[36mINFO�[0m[2025-03-10T11:09:58Z] RUN mkdir -p /app && chown node:node /app
�[36mINFO�[0m[2025-03-10T11:09:58Z] Cmd: /bin/sh
�[36mINFO�[0m[2025-03-10T11:09:58Z] Args: [-c mkdir -p /app && chown node:node /app]
�[36mINFO�[0m[2025-03-10T11:09:58Z] Running: [/bin/sh -c mkdir -p /app && chown node:node /app]
�[36mINFO�[0m[2025-03-10T11:09:58Z] Taking snapshot of full filesystem...
�[36mINFO�[0m[2025-03-10T11:09:58Z] WORKDIR /app
�[36mINFO�[0m[2025-03-10T11:09:58Z] Cmd: workdir
�[36mINFO�[0m[2025-03-10T11:09:58Z] Changed working directory to /app
�[36mINFO�[0m[2025-03-10T11:09:58Z] No files changed in this command, skipping snapshotting.
�[36mINFO�[0m[2025-03-10T11:09:58Z] USER node
�[36mINFO�[0m[2025-03-10T11:09:58Z] Cmd: USER
�[36mINFO�[0m[2025-03-10T11:09:58Z] COPY --chown=node:node . .
�[36mINFO�[0m[2025-03-10T11:09:59Z] Taking snapshot of files...
�[36mINFO�[0m[2025-03-10T11:09:59Z] RUN touch .env ; npm config set strict-ssl false ; npm config set registry "https://npm.<custom>.cn/repository/npm-npmjs" ; npm config set proxy ${HTTP_PROXY} && npm config set https-proxy ${HTTPS_PROXY} && npm config set noproxy "${NO_PROXY}" ; mkdir -p /app/client/public/images /app/api/logs ; npm install npm run frontend; npm cache clean --force
�[36mINFO�[0m[2025-03-10T11:09:59Z] Cmd: /bin/sh
�[36mINFO�[0m[2025-03-10T11:09:59Z] Args: [-c touch .env ; npm config set strict-ssl false ; npm config set registry "https://npm.<custom>.cn/repository/npm-npmjs" ; npm config set proxy ${HTTP_PROXY} && npm config set https-proxy ${HTTPS_PROXY} && npm config set noproxy "${NO_PROXY}" ; mkdir -p /app/client/public/images /app/api/logs ; npm install npm run frontend; npm cache clean --force]
�[36mINFO�[0m[2025-03-10T11:09:59Z] Util.Lookup returned: &{Uid:1000 Gid:1000 Username:node Name: HomeDir:/home/node}
�[36mINFO�[0m[2025-03-10T11:09:59Z] Performing slow lookup of group ids for node
�[36mINFO�[0m[2025-03-10T11:09:59Z] Running: [/bin/sh -c touch .env ; npm config set strict-ssl false ; npm config set registry "https://npm.<custom>.cn/repository/npm-npmjs" ; npm config set proxy ${HTTP_PROXY} && npm config set https-proxy ${HTTPS_PROXY} && npm config set noproxy "${NO_PROXY}" ; mkdir -p /app/client/public/images /app/api/logs ; npm install npm run frontend; npm cache clean --force]
npm warn deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm warn deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm warn deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm warn deprecated [email protected]: this library is no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm warn deprecated [email protected]: This package is deprecated. Use destructuring assignment syntax instead.
npm warn deprecated [email protected]: This package is deprecated. Use structuredClone instead.
npm warn deprecated [email protected]: Node Sass is no longer supported. Please use `sass` or `sass-embedded` instead.
npm warn deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated [email protected]: Use your platform's native DOMException instead
npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @types/[email protected]: This is a stub types definition. winston provides its own type definitions, so you do not need this installed.
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package has been decomissioned. See https://github.com/ldapjs/node-ldapjs/blob/8ffd0bc9c149088a10ec4c1ec6a18450f76ad05d/README.md
npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm error code 1
npm error path /app/node_modules/sharp
npm error command failed
npm error command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm error sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.5/libvips-8.14.5-linuxmusl-x64.tar.br
npm error sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm error sharp: Installation error: connect ECONNREFUSED 127.0.0.1:443
npm error A complete log of this run can be found in: /home/node/.npm/_logs/2025-03-10T11_10_01_428Z-debug-0.log
npm warn using --force Recommended protections disabled.
�[36mINFO�[0m[2025-03-10T11:12:16Z] Taking snapshot of full filesystem...
�[36mINFO�[0m[2025-03-10T11:12:17Z] RUN mkdir -p /app/client/public/images /app/api/logs
�[36mINFO�[0m[2025-03-10T11:12:17Z] Cmd: /bin/sh
�[36mINFO�[0m[2025-03-10T11:12:17Z] Args: [-c mkdir -p /app/client/public/images /app/api/logs]
�[36mINFO�[0m[2025-03-10T11:12:17Z] Util.Lookup returned: &{Uid:1000 Gid:1000 Username:node Name: HomeDir:/home/node}
�[36mINFO�[0m[2025-03-10T11:12:17Z] Performing slow lookup of group ids for node
�[36mINFO�[0m[2025-03-10T11:12:17Z] Running: [/bin/sh -c mkdir -p /app/client/public/images /app/api/logs]
�[36mINFO�[0m[2025-03-10T11:12:17Z] Taking snapshot of full filesystem...
�[36mINFO�[0m[2025-03-10T11:12:17Z] No files were changed, appending empty layer to config. No layer added to image.
�[36mINFO�[0m[2025-03-10T11:12:17Z] EXPOSE 3080
�[36mINFO�[0m[2025-03-10T11:12:17Z] Cmd: EXPOSE
�[36mINFO�[0m[2025-03-10T11:12:17Z] Adding exposed port: 3080/tcp
�[36mINFO�[0m[2025-03-10T11:12:17Z] ENV HOST=0.0.0.0
�[36mINFO�[0m[2025-03-10T11:12:17Z] CMD ["npm", "run", "backend"]
�[36mINFO�[0m[2025-03-10T11:12:17Z] Pushing image to custom.registry.io/custom_library/librechat:0.7.7
�[36mINFO�[0m[2025-03-10T11:12:17Z] Pushed custom.registry.io/custom_library/librechat@sha256:eb1fca92e33408adc853d75ea0f5b0494f34155ae6f4085ac2b4b544a2f563a5
section_end:1741605138:step_script
�[0Ksection_start:1741605138:cleanup_file_variables
�[0K�[0K�[36;1mCleaning up project directory and file based variables�[0;m�[0;m
section_end:1741605138:cleanup_file_variables
�[0K�[32;1mJob succeeded�[0;m Version Information[email protected] backend
sh: cross-env: not found Steps to Reproduce
What browsers are you seeing the problem on?Microsoft Edge Relevant log outputScreenshotsNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Docker builds are not failing in our CI/CD pipeline nor locally in my tests, on latest nor v0.7.7 tag. Try updating docker/docker compose, remove existing images, and use build with “—no-cache” flag. https://github.com/danny-avila/LibreChat/blob/main/.github/workflows/dev-images.yml |
Beta Was this translation helpful? Give feedback.
-
How can I just use |
Beta Was this translation helpful? Give feedback.
-
Hi @berg-wang, were you able to successfully start the locally built image? @danny-avila, could you lend a hand? I'm encountering an error when running ubuntu@ubuntu:~/LibreChat$ docker run -p 3080:3080 librechat:0.7.7
> [email protected] backend
> cross-env NODE_ENV=production node api/server/index.js
node:buffer:322
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
at Function.from (node:buffer:322:9)
at Object.<anonymous> (/app/api/server/utils/crypto.js:6:20)
at Module._compile (node:internal/modules/cjs/loader:1529:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
at Module.load (node:internal/modules/cjs/loader:1275:32)
at Module._load (node:internal/modules/cjs/loader:1096:12)
at Module.require (node:internal/modules/cjs/loader:1298:19)
at require (node:internal/modules/helpers:182:18)
at Object.<anonymous> (/app/api/server/utils/index.js:6:21)
at Module._compile (node:internal/modules/cjs/loader:1529:14) {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v20.19.0
ubuntu@ubuntu:~/LibreChat$ |
Beta Was this translation helpful? Give feedback.
Docker builds are not failing in our CI/CD pipeline nor locally in my tests, on latest nor v0.7.7 tag. Try updating docker/docker compose, remove existing images, and use build with “—no-cache” flag.
https://github.com/danny-avila/LibreChat/blob/main/.github/workflows/dev-images.yml