gchq / gchq/CyberChef

Failure when building

Open
#1,989 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

**Describe the bug**
While building the docker container I get an error on grunt-cli. It was not installed successfully.

**To Reproduce**

```
$ docker build --tag cyberchef --ulimit nofile=10000 .
docker run -p 8080:80 cyberchef
[+] Building 5.5s (10/11) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 203B 0.0s
=> [internal] load metadata for docker.io/library/node:18-alpine 0.8s
=> [internal] load metadata for docker.io/library/nginx:1.25-alpine3.18 0.8s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 59B 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 49.98kB 0.2s
=> [build 1/4] FROM docker.io/library/node:18-alpine@sha256:e0340f26173b41066d68e3fe9bfbdb6571ab3cad0a4272919a52e36f4ae56925 0.0s
=> CACHED [cyberchef 1/2] FROM docker.io/library/nginx:1.25-alpine3.18@sha256:31bad00311cb5eeb8a6648beadcf67277a175da89989f14727420a80 0.0s
=> CACHED [build 2/4] COPY . . 0.0s
=> CACHED [build 3/4] RUN npm ci 0.0s
=> ERROR [build 4/4] RUN npm run build 4.4s
------
> [build 4/4] RUN npm run build:
0.229
0.229 > cyberchef@10.19.4 build
0.229 > npx grunt prod
0.229
1.223 npm warn exec The following package was not found and will be installed: grunt@1.6.1
3.571 npm warn deprecated osenv@0.1.5: This package is no longer supported.
3.853 npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
3.895 npm warn deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported
4.345 grunt-cli: The grunt command line interface (v1.4.3)
4.346
4.346 Fatal error: Unable to find local grunt.
4.346
4.346 If you're seeing this message, grunt hasn't been installed locally to
4.346 your project. For more information about installing and configuring grunt,
4.346 please see the Getting Started guide:
4.346
4.346 https://gruntjs.com/getting-started
------
Dockerfile:5
--------------------
3 | COPY . .
4 | RUN npm ci
5 | >>> RUN npm run build
6 |
7 | FROM nginx:1.25-alpine3.18 AS cyberchef
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 99
```

**Desktop (if relevant, please complete the following information):**
- OS: `6.11.0-14-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 10 23:05:39 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux`
- System: Running in parallels VM on Mac M1
- Browser: not relevant
- CyberChef version: git commit d3357d2acd1b2d0ead56130c7182c26b8a0053f2 (current master)

Contributor guide

Open the contributing guide

Research direction

Start with Dockerfile line 5 and the npm build command shown in the report. Run the reported docker build to reproduce the missing local grunt failure, then inspect how npm ci installs the build dependencies. Done means the image builds successfully and npm run build completes without the grunt-cli error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, node.js
Domain
build-system, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.