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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃殌] Running Juice-shop in Raspberry Pi 4 (linux/arm/v8) #2044

Closed
doop-lan opened this issue Jul 20, 2023 · 10 comments
Closed

[馃殌] Running Juice-shop in Raspberry Pi 4 (linux/arm/v8) #2044

doop-lan opened this issue Jul 20, 2023 · 10 comments
Labels

Comments

@doop-lan
Copy link

doop-lan commented Jul 20, 2023

馃殌 Feature request

Description

I've been trying to get the juice-shop docker image to run on a new raspberry pi 4 but it seems that the old images are not compatible with my pi.

I've found that in issue #1369 a similar problem had occurred, but when trying to run either run their image or the one in the official repo, I always end up with issues.

Official repo (using bkimminich/juice-shop:latest-arm

$ docker run --rm -p 3000:3000 bkimminich/juice-shop:latest-arm

juice-shop@14.4.0 start /juice-shop
node build/app

info: All dependencies in ./package.json are satisfied (OK)
(node:18) UnhandledPromiseRejectionWarning: Error: Please install sqlite3 package manually
at ConnectionManager._loadDialectModule (/juice-shop/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:55:15)
at new ConnectionManager (/juice-shop/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:18:21)
at new SqliteDialect (/juice-shop/node_modules/sequelize/lib/dialects/sqlite/index.js:13:30)
at new Sequelize (/juice-shop/node_modules/sequelize/lib/sequelize.js:193:20)
at Object. (/juice-shop/build/models/index.js:30:19)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
(Use node --trace-warnings ... to show where the warning was created)
(node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:18) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Using the image supplied by the other user

$ docker run --rm -p 3000:3000 santosomar/juice-shop-arm64
WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/arm/v8) and no specific platform was requested

I've even tried making my own Dockerfile but this resulted in the following

$ docker build --tag 'juice-shop-arm64v8' .
[+] Building 2.2s (8/8) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 287B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/arm64v8/node:12 1.0s
=> [internal] load build context 0.2s
=> => transferring context: 81.36kB 0.2s
=> [1/4] FROM docker.io/arm64v8/node:12@sha256:4deb892a653993b3bc611a50993528129c22cc411487d5b68aa2923682b7b093 0.0s
=> CACHED [2/4] COPY . /juice-shop 0.0s
=> CACHED [3/4] WORKDIR /juice-shop 0.0s
=> ERROR [4/4] RUN npm install --production --unsafe-perm 0.8s

[4/4] RUN npm install --production --unsafe-perm:


Dockerfile:7

5 | COPY . /juice-shop
6 | WORKDIR /juice-shop
7 | >>> RUN npm install --production --unsafe-perm
8 |
9 | EXPOSE 3000

ERROR: failed to solve: process "/bin/sh -c npm install --production --unsafe-perm" did not complete successfully: exit code: 159

Solution ideas

If at all possible, it would be amazing if linux/arm/v8 would be supported.

Possible alternatives

I've been trying to get the v7 one to run, but for some reason sqlite3 seems to not be installed on that one, thus it's failing to run.

@doop-lan
Copy link
Author

I managed to build the Dockerfile.arm, but again I run into the issue that sqlite3 doesn't seem to be installed.

@bkimminich
Copy link
Member

We do not build extra tags for arm/v7 and more, but the regular image is built for amd64 and arm64 simultaneuously. Did you just try that one, too?

docker run --rm -p 3000:3000 bkimminich/juice-shop:latest

@doop-lan
Copy link
Author

doop-lan commented Jul 23, 2023

We do not build extra tags for arm/v7 and more, but the regular image is built for amd64 and arm64 simultaneuously. Did you just try that one, too?

docker run --rm -p 3000:3000 bkimminich/juice-shop:latest

First off, thanks for the quick reply!

So when I try this, I get the following:

$ docker run --rm -p 3000:3000 bkimminich/juice-shop:latest Unable to find image 'bkimminich/juice-shop:latest' locally latest: Pulling from bkimminich/juice-shop docker: no matching manifest for linux/arm/v8 in the manifest list entries. See 'docker run --help'.

@bkimminich
Copy link
Member

Ok, thanks for trying. Seems the arm64 image isn't compatible with your v8 processor then. We dropped v7 some time ago as it wouldn't stop causing trouble, I could imagine v8 is the same? Our official image supports amd64 and arm64 only currently. Maybe try an arm64 friendly OS on your Pi and see if that works?

@doop-lan
Copy link
Author

doop-lan commented Jul 23, 2023

I'm definitely willing to try that. I'll try setting up debian on the pi tomorrow and see if that works, and give you an update on how that goes.

@doop-lan
Copy link
Author

doop-lan commented Jul 24, 2023

@bkimminich I can confirm that on Ubuntu Server 64bit (Linux ubuntu 6.2.0-1008-raspi) it works using the latest image.
Quite strange that it doesn't work out of the box, but I can live with this solution. Thanks!

@mdpung
Copy link

mdpung commented Apr 28, 2024

Unfortunate to hear there's no more support for arm/v7 :(

@J12934
Copy link
Member

J12934 commented Apr 28, 2024

@mdpung can you go into more detail on why you need arm/v7 support and why arm64 is not a option for you?

We were hoping that arm64 would cover most use cases, I would be interested to hear of other setups people are using that arm64 can't cover.

@mdpung
Copy link

mdpung commented May 8, 2024

@mdpung can you go into more detail on why you need arm/v7 support and why arm64 is not a option for you?

We were hoping that arm64 would cover most use cases, I would be interested to hear of other setups people are using that arm64 can't cover.

I have a Tinkerboard S (ASUS's version of Pi) and run TinkerOS. The board uses an ARMv7 instruction set.

@bkimminich
Copy link
Member

bkimminich commented May 8, 2024

According to https://en.m.wikipedia.org/wiki/Asus_Tinker_Board that model is from 2018 and only supports ARM/V7 but starting with the Tinker Edge T onward they use ARM/V8 64bit which should work without issues with our Docker images again.

If you want to keep your Tinkerboard S, you could probably get our last ARM/V7 image to run on it: docker pull bkimminich/juice-shop:v12.1.1-armv7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants