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

How to use on raspberry pi 4 #402

Closed
X1pheR opened this issue Jan 23, 2022 · 7 comments
Closed

How to use on raspberry pi 4 #402

X1pheR opened this issue Jan 23, 2022 · 7 comments

Comments

@X1pheR
Copy link

X1pheR commented Jan 23, 2022

Would it be possible to provide a dockerfile for use on a raspberry pi 4 arm64? I tried modifying the current one but getting errors on the root and rootfs

@manuc66
Copy link
Owner

manuc66 commented Feb 6, 2022

Hi @X1pheR

Maybe you can try:

FROM arm64v8/node:alpine as build
WORKDIR /app

ADD . .
RUN yarn install -d \
 && yarn build \
 && rm dist/*.d.ts dist/*.js.map

FROM node:alpine as app
ENV NODE_ENV production
ADD root/ /

# add S6 Overlay, install shadow (for groupmod and usermod) and tzdata (for TZ env variable)
ADD https://github.com/just-containers/s6-overlay/releases/download/v2.2.0.3/s6-overlay-armhf.tar.gz /tmp/
RUN tar xzf /tmp/s6-overlay-armhf.tar.gz -C / \
 && apk add --no-cache shadow tzdata

# add builded app
WORKDIR /app
COPY --from=build /app/dist/ /app/package.json ./
RUN yarn install -d \
 && yarn cache clean --force

VOLUME ["/scan"]
ENTRYPOINT ["/init"]
CMD ["/app.sh"]

@charlie89
Copy link
Contributor

@manuc66: There are ways to build multi-arch images for docker, so we could at least provide one for x86_64 hardware and one for arm64 hardware like a raspberry pi 4.

I own a raspberry pi 4 (running octoprint for 3d printing) and i'm thinking of converting it to docker so i can run additional services on it. That's probably happening in the next few months, then i could create a multi-arch container and test it on a raspberry pi.

Docker's buildx system described here seems official and easy to use, so i could write all the scripts necessary for it. I'm not completely sure but i think currently you configured a build job on Docker Hub to build the image. According to the guide it would then use a github action instead, so you would just have to disable the current build job and add a Docker Hub access token to the repository in the secrets section.

What do you think about that?

@manuc66
Copy link
Owner

manuc66 commented Apr 13, 2022

@charlie89 Good proposal to have multi-arch docker images

Today image are build with : https://github.com/manuc66/node-hp-scan-to/blob/master/.travis.yml#L17 but this can be changed of course

@clintonpower
Copy link

@manuc66 Thank you so much for the fast update! I am receiving the following error on RPi 3B+
node-hp-scan-to | /command/s6-overlay-suexec: line 1: syntax error: unexpected ")"
Am I missing something?

@manuc66
Copy link
Owner

manuc66 commented Jul 23, 2022

@clintonpower Could you try again, I forgot to use the appropriate S6 according to the arch (see: 13c0fcf)

@clintonpower
Copy link

@manuc66 it works like a charm now, thank you so much, I appreciate your work!

@manuc66 manuc66 closed this as completed Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants