AykutSarac / jsoncrack.com

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML, CSV and more, into interactive graphs.
https://jsoncrack.com/
Other
30.5k stars 1.89k forks source link

[BUG]: Docker build fails due to yarn frozen-lockfile #347

Closed FoxInTheB0xFFF closed 7 months ago

FoxInTheB0xFFF commented 1 year ago

Issue description

I tried to build from Docker using $ docker build -t jsoncrack .

Here is the output from the build attempt…

~/repos/jsoncrack.com)──────────────(xxxxxxxxxx@xxxxxxxxx:s002)─┐
└─(00:07:36 on main)──> docker build -t jsoncrack .       130 ↵ ──(Mon,Aug07)─┘
[+] Building 37.1s (10/12)
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 2B                                            0.0s
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 298B                                       0.0s
 => [internal] load metadata for docker.io/nginxinc/nginx-unprivileged:la  1.8s
 => [internal] load metadata for docker.io/library/node:18-alpine          1.9s
 => [builder 1/4] FROM docker.io/library/node:18-alpine@sha256:93d91deea6  0.0s
 => CACHED [stage-1 1/3] FROM docker.io/nginxinc/nginx-unprivileged@sha25  0.0s
 => [internal] load build context                                          2.4s
 => => transferring context: 2.89MB                                        2.2s
 => CACHED [builder 2/4] WORKDIR /src                                      0.0s
 => CACHED [builder 3/4] COPY . /src/                                      0.0s
 => ERROR [builder 4/4] RUN yarn install --frozen-lockfile && yarn build  32.7s
------
 > [builder 4/4] RUN yarn install --frozen-lockfile && yarn build:
#0 1.073 yarn install v1.22.19
#0 1.181 [1/4] Resolving packages...
#0 1.461 [2/4] Fetching packages...
#0 23.59 [3/4] Linking dependencies...
#0 23.59 warning " > @monaco-editor/react@4.5.1" has unmet peer dependency "monaco-editor@>= 0.25.0 < 1".
#0 23.59 warning "@monaco-editor/react > @monaco-editor/loader@1.3.3" has unmet peer dependency "monaco-editor@>= 0.21.0 < 1".
#0 23.60 warning " > react-ga@3.3.1" has unmet peer dependency "prop-types@^15.6.0".
#0 23.60 warning "react-hot-toast > goober@2.1.13" has unmet peer dependency "csstype@^3.0.10".
#0 31.10 [4/4] Building fresh packages...
#0 31.55 error /src/node_modules/bufferutil: Command failed.
#0 31.55 Exit code: 1
#0 31.55 Command: node-gyp-build
#0 31.55 Arguments:
#0 31.55 Directory: /src/node_modules/bufferutil
#0 31.55 Output:
#0 31.55 gyp info it worked if it ends with ok
#0 31.55 gyp info using node-gyp@9.3.1
#0 31.55 gyp info using node@18.17.0 | linux | arm64
#0 31.55 gyp ERR! find Python
#0 31.55 gyp ERR! find Python Python is not set from command line or npm configuration
#0 31.55 gyp ERR! find Python Python is not set from environment variable PYTHON
#0 31.55 gyp ERR! find Python checking if "python3" can be used
#0 31.55 gyp ERR! find Python - "python3" is not in PATH or produced an error
#0 31.55 gyp ERR! find Python checking if "python" can be used
#0 31.55 gyp ERR! find Python - "python" is not in PATH or produced an error
#0 31.55 gyp ERR! find Python
#0 31.55 gyp ERR! find Python **********************************************************
#0 31.55 gyp ERR! find Python You need to install the latest version of Python.
#0 31.55 gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
#0 31.55 gyp ERR! find Python you can try one of the following options:
#0 31.55 gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
#0 31.55 gyp ERR! find Python   (accepted by both node-gyp and npm)
#0 31.55 gyp ERR! find Python - Set the environment variable PYTHON
#0 31.55 gyp ERR! find Python - Set the npm configuration variable python:
#0 31.55 gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
#0 31.55 gyp ERR! find Python For more information consult the documentation at:
#0 31.55 gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
#0 31.55 gyp ERR! find Python **********************************************************
#0 31.55 gyp ERR! find Python
#0 31.55 gyp ERR! configure error
#0 31.55 gyp ERR! stack Error: Could not find any Python installation to use
#0 31.55 gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
#0 31.55 gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
#0 31.55 gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
#0 31.55 gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
#0 31.55 gyp ERR! stack     at exithandler (node:child_process:427:5)
#0 31.55 gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:439:5)
#0 31.55 gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
#0 31.55 gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
#0 31.55 gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
#0 31.55 gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
#0 31.55 gyp ERR! System Linux 5.15.49-linuxkit
#0 31.55 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
#0 31.55 gyp ERR! cwd /src/node_modules/bufferutil
#0 31.55 gyp ERR! node -v v18.17.0
#0 31.55 gyp ERR! node-gyp -v v9.3.1
#0 31.55 gyp ERR! not ok
#0 31.55 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
Dockerfile:5
--------------------
   3 |     WORKDIR /src
   4 |     COPY . /src/
   5 | >>> RUN yarn install --frozen-lockfile && yarn build
   6 |
   7 |     # App
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn install --frozen-lockfile && yarn build" did not complete successfully: exit code: 1

Media & Screenshots

No response

Operating system

Priority this issue should have

Medium (should be fixed soon)

FoxInTheB0xFFF commented 1 year ago

Updated test results…

Environment(s): Test on the following docker versions

rich1e commented 1 year ago

I'm having the same issue too.

Try the local installation without error. But it can't be built.

❯ yarn build                    
yarn run v1.22.19
$ next build
- info Loaded env from /jsoncrack.com/.env.production
- info Linting and checking validity of types  
error - No Sentry auth token configured. Source maps will not be uploaded.
You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/
After generating a Sentry auth token, set it via the SENTRY_AUTH_TOKEN environment variable during the build.

- info Creating an optimized production build  
- info Compiled successfully
- info Collecting page data  
[    ] - info Generating static pages (0/10)
Error occurred prerendering page "/oss". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: fetch failed
    at Object.fetch (/jsoncrack.com/node_modules/next/dist/compiled/undici/index.js:1:26669)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getStaticProps$1 (/jsoncrack.com/.next/server/pages/oss.js:127:17)
- info Generating static pages (10/10)

> Export encountered errors on following paths:
        /oss
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ffineis commented 1 year ago

Worked on reverting to 3b4baf7 (v3.0.0)

somera commented 1 year ago

It works ... was my mistake

jinnabaalu commented 1 year ago

We can close this issue, I don't see any issue running the docker

hidakafinzelz commented 10 months ago

I faced the same bug.