question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🚀] Running Juice-shop in Raspberry Pi 4

See original GitHub issue

🚀 Feature request

Description

In issue #380 , @battletux was kind enough to provide a solution to run Juice-Shop in a Docker container inside of a Raspberry Pi (as shown below) and in the Docker Hub repository at: https://hub.docker.com/r/arclight/juice-shop_arm

Unfortunately, this does not work in newer platforms such as the Raspberry Pi 4. This was the original Dockerfile in issue #380:

# OWASP Juice Shop - An intentionally insecure JavaScript Web Application
FROM            arm32v7/node:6
LABEL version = "5.0.0"

COPY . /juice-shop
WORKDIR /juice-shop
RUN npm install --production --unsafe-perm

EXPOSE  3000
CMD ["npm", "start"]

Running this in a Raspberry Pi 4 does not work and generates the following errors:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /juice-shop/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/juice-shop/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-04-17T03_39_11_426Z-debug.log

Solution ideas

I am opening this issue to try to fix it and (if I am successful) I will document the solution here. If I am not successful in the next week or so, I will close this issue and leave it as a documented problem.

Possible alternatives

I also tried the latest arm32v7/node image and it didn’t work.

FROM            arm32v7/node

However, I will try to build the container manually and (again, if successful) I will upload to Docker Hub and document it here.

Running Juice-shop in Raspberry Pi’s allow students with low resources to build a cool lab. I am a super big fan of Juice-shop and run it in numerous environments (cloud, intel nucs with containers, proxmox, etc.).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:26 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
santosomarcommented, Apr 23, 2020

The Travis-CI jobs are now caching more efficiently and use npm prune --production instead of deleting all node_modules resulting in way faster builds even on arm64. Timeouts do not occur any more.

@santosomar, could you maybe check if the v10.2.1 package still works inside a Docker image on your RasPi? Also, I’ve added a variable in my ebook for the last Juice Shop version you built the Arm-based Docker image for:

"armDockerImageVersion": "v10.2.0"

If you think about automating your image creation somehow, please let me know, then I remove it again. Otherwise I’ll try to remember to regularly check for your current version and update the variable. You can of course also send a PR updating it in https://github.com/bkimminich/pwning-juice-shop/blob/master/book.json and https://github.com/bkimminich/pwning-juice-shop/blob/master/book-ctf.json.

Works like a charm!

> juice-shop@10.2.1 start /root/juice-shop_10.2.1
> node app

info: All dependencies in ./package.json are satisfied (OK)
info: Detected Node.js version v12.16.2 (OK)
info: Detected OS linux (OK)
info: Detected CPU arm64 (OK)
info: Required file index.html is present (OK)
info: Required file styles.css is present (OK)
info: Required file main-es2015.js is present (OK)
info: Required file tutorial-es2015.js is present (OK)
info: Required file polyfills-es2015.js is present (OK)
info: Required file runtime-es2015.js is present (OK)
info: Required file vendor-es2015.js is present (OK)
info: Required file main-es5.js is present (OK)
info: Required file tutorial-es5.js is present (OK)
info: Required file polyfills-es5.js is present (OK)
info: Required file runtime-es5.js is present (OK)
info: Required file vendor-es5.js is present (OK)
info: Configuration default validated (OK)
info: Port 3000 is available (OK)
<output ommited for brevity>
info: Server listening on port 3000
1reaction
bkimminichcommented, Apr 23, 2020

The Travis-CI jobs are now caching more efficiently and use npm prune --production instead of deleting all node_modules resulting in way faster builds even on arm64. Timeouts do not occur any more.

@santosomar, could you maybe check if the v10.2.1 package still works inside a Docker image on your RasPi? Also, I’ve added a variable in my ebook for the last Juice Shop version you built the Arm-based Docker image for:

"armDockerImageVersion": "v10.2.0"

If you think about automating your image creation somehow, please let me know, then I remove it again. Otherwise I’ll try to remember to regularly check for your current version and update the variable. You can of course also send a PR updating it in https://github.com/bkimminich/pwning-juice-shop/blob/master/book.json and https://github.com/bkimminich/pwning-juice-shop/blob/master/book-ctf.json.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ 🚀 ] Running Juice-shop in Raspberry Pi 4 #1369 - GitHub
Running Juice -shop in Raspberry Pi's allow students with low resources to build a cool lab. I am a super big fan of...
Read more >
Running OWASP Juice Shop
To run a single instance of Juice Shop the following memory and CPU requirements apply. These resources are needed for the Juice Shop...
Read more >
Files · a9843054cd3704b9ea5f127f278ee8b9f2c349d2 · estcuer ...
If you want to run Juice Shop on a Raspberry Pi 3, there is an unofficial Docker image ... Search for juice-shop and...
Read more >
Raspberry Pi As Wake on LAN Server - Instructables
1. The physical set up I don't think this could be any easier. LAN cable has 2 ends plug one of them to the...
Read more >
Preparing a Raspberry Pi - Rocket Pool
What You'll Need. These are the recommended components that you'll need to buy in order to run Rocket Pool on a Pi: A...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found