Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Can not build jsoncrack image #375

Open
crazyyzarc opened this issue Jan 12, 2024 · 5 comments
Open

[BUG]: Can not build jsoncrack image #375

crazyyzarc opened this issue Jan 12, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@crazyyzarc
Copy link

crazyyzarc commented Jan 12, 2024

Issue description

Hey,
I used the docker-compose.yml that is supposed to create the Dockerfile. During execution, the error shown below occurs.

Thanks

Media & Screenshots

2024-01-12_19-37-51-076_eLzBf

source

[+] Running 1/1
 ! jsoncrack Warning                                                                                                                                                                          1.4s 
[+] Building 1.3s (12/16)                                                                                                                                                                          
 => [jsoncrack internal] load build definition from Dockerfile                                                                                                                                0.0s
 => => transferring dockerfile: 375B                                                                                                                                                          0.0s
 => [jsoncrack internal] load .dockerignore                                                                                                                                                   0.0s
 => => transferring context: 268B                                                                                                                                                             0.0s
 => [jsoncrack internal] load metadata for docker.io/nginxinc/nginx-unprivileged:latest                                                                                                       0.8s
 => [jsoncrack internal] load metadata for docker.io/library/node:18-alpine                                                                                                                   0.8s
 => [jsoncrack auth] library/node:pull token for registry-1.docker.io                                                                                                                         0.0s
 => [jsoncrack auth] nginxinc/nginx-unprivileged:pull token for registry-1.docker.io                                                                                                          0.0s
 => [jsoncrack builder 1/6] FROM docker.io/library/node:18-alpine@sha256:b1a0356f7d6b86c958a06949d3db3f7fb27f95f627aa6157cb98bc65c801efa2                                                     0.0s
 => [jsoncrack internal] load build context                                                                                                                                                   0.1s
 => => transferring context: 16.84MB                                                                                                                                                          0.1s
 => CANCELED [jsoncrack stage-1 1/3] FROM docker.io/nginxinc/nginx-unprivileged@sha256:3ae7d1f0aac6fb9189a2912921e704e56c3a5c20bf526cfeb3c801cdaba66330                                       0.4s
 => => resolve docker.io/nginxinc/nginx-unprivileged@sha256:3ae7d1f0aac6fb9189a2912921e704e56c3a5c20bf526cfeb3c801cdaba66330                                                                  0.0s
 => => sha256:3ae7d1f0aac6fb9189a2912921e704e56c3a5c20bf526cfeb3c801cdaba66330 6.18kB / 6.18kB                                                                                                0.0s
 => => sha256:90a601ff25740c67da8d6a1c1620c2a8f8662e1dd173aff38e1d116fbe34a5b8 9.05kB / 9.05kB                                                                                                0.0s
 => => sha256:3158fd7c16798d9c904f85daca33e69967705763344cb37e082846bd02f12119 3.15MB / 41.37MB                                                                                               0.4s
 => => sha256:45c33830aa1098fbe6e87b22593d92d84c49e6fb333d6814d5bab4d7027d133f 2.75kB / 2.75kB                                                                                                0.4s
 => => sha256:a8dadcabab71ecf8fa709efbac2f513b7a22dadcac09c70190c97791e72d32cb 626B / 626B                                                                                                    0.3s
 => => sha256:d0c8b939b4df6e479a782143edf2c0e1c62a93df53bbc10d611b0ae9ad03c64b 1.81kB / 1.81kB                                                                                                0.0s
 => => sha256:99da08f1c3e24f9e74610fcda8be405d0f062ddd9b6578405626c6e6dcbb6e3e 0B / 956B                                                                                                      0.4s
 => CACHED [jsoncrack builder 2/6] WORKDIR /src                                                                                                                                               0.0s
 => CACHED [jsoncrack builder 3/6] COPY package.json pnpm-lock.yaml ./                                                                                                                        0.0s
 => ERROR [jsoncrack builder 4/6] RUN pnpm install                                                                                                                                            0.3s
------
 > [jsoncrack builder 4/6] RUN pnpm install:
0.277 /bin/sh: pnpm: not found
------
WARN[0001] buildx: failed to read current commit information with git rev-parse --is-inside-work-tree 
failed to solve: process "/bin/sh -c pnpm install" did not complete successfully: exit code: 127

Operating system

  • OS: Debian Bookworm

Priority this issue should have

Normal (I can't use it)

@crazyyzarc crazyyzarc added the bug Something isn't working label Jan 12, 2024
@hideintheclouds
Copy link

You could try to update the dockerfile and install the pnpm package before using it:
RUN pnpm install

@o-lenczyk
Copy link

how do you install it?

wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh - is not working
probably pnpm is not in path

@WebKenth
Copy link

Just a note here

If you change it to

--- a/Dockerfile
+++ b/Dockerfile
@@ -4,11 +4,11 @@ WORKDIR /src

 # Cache dependencies first
 COPY package.json pnpm-lock.yaml ./
-RUN pnpm install
+RUN npm install

 # Copy other files and build
 COPY . /src/
-RUN pnpm build
+RUN npm run build

 # App
 FROM nginxinc/nginx-unprivileged

The docker build -t jsoncrack . works

@derfel1989
Copy link

@crazyyzarc

Update your Dockerfile like below:

# Builder
FROM node:18-alpine as builder
RUN corepack enable
WORKDIR /src

# Cache dependencies first
COPY package.json pnpm-lock.yaml ./
RUN pnpm install

# Copy other files and build
COPY . /src/
RUN pnpm build

# App
FROM nginxinc/nginx-unprivileged
COPY --chown=nginx:nginx --from=builder /src/out /app
COPY default.conf /etc/nginx/conf.d/default.conf`

@codeman98
Copy link

commented

think you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants