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

[ARM] Use arm32v6/node alpine base image #102

Closed
wants to merge 2 commits into from

Conversation

RandomByte
Copy link
Contributor

By changing the base image to arm32v6/node I reduced the image size from 416MB to 155MB.

Might not sound like much, but keep in mind that Raspberry Pis and other ARM based microcomputers are often equipped with litte memory.

image

It's running on my Pi for a week now without issues.

@ManoMarks
Copy link
Contributor

@alexellis seems reasonable, what do you think?

Image size reduction: 416MB -> 155MB
@DovAmir
Copy link
Contributor

DovAmir commented Jan 30, 2018

Sounds like a good idea to me

@DovAmir
Copy link
Contributor

DovAmir commented Jan 30, 2018

hey @ManoMarks , as a large contributor to this project I would be happy to get collaborator privileges and become more involved

@ManoMarks
Copy link
Contributor

Sorry @DovAmir we only have Docker employees or contractors as team members. Also we're not really actively developing this sample, just patching as problems emerge. Thanks for the offer though.

@estesp
Copy link
Contributor

estesp commented Feb 1, 2018

Have you tried just using the main Dockerfile for the project, even on ARM32? The main node images on DockerHub are now multi-arch, so a build of the main project Dockerfile should suffice on ARM32, ppc64le, s390x, amd64.. if that works, we should consider deleting this Dockerfile as it has gotten out of sync with the main Dockerfile

@StefanScherer
Copy link
Contributor

Moving to the official Node image for ARM is a good idea.
Alpine is a very good move to reduce download and extracting time.

Only thing might be if we should use the Node LTS version, which is 8.
But version 9 should work as well.

@StefanScherer
Copy link
Contributor

Good idea @estesp. For such a cleanup I suggest to remove the Dockerfile.aarch64 and Dockerfile.arm and use the multi-arch FROM node:8-alpine which covers amd64, ARM64v8, ARMv6 and many more.

Next step could be to cleanup up the README.md and just use image name dockersamples/visualizer for all platforms and provide it as a multi-arch image as well. The remaining Dockerfile should have build args to be able to build multiple platform images as described here. I guess we don't need qemu tricks here, a simple COPY deployment into the final stage should work for this visualizer as well. Then manifest-tool or docker manifest create command should do the rest to push a multi-arch dockersamples/visualizer manifest list. If there is interest I'm happy to help.

@alexellis
Copy link
Contributor

alexellis commented Feb 2, 2018

This change makes sense - the size difference is because I used Raspbian as a base image for my original version and now we have access to Alpine for ARM which is lighter weight. The image being pointed at I believe is the official arm image already, but we can point at the "shortcut" or "main" image which is called "node:9-alpine" (like Stefan/Phil pointed out)

I will take some time today to test it out and let you know how it looks. As for ARM64 that should work too.

Edit: I can confirm that node:8-alpine works on the RPi Zero and RPi3 (often despite having an entry in the manifests list it may not actually work and produce an exec error) - so I would suggest changing over to node:8-alpine. @RandomByte @ManoMarks

@alexellis
Copy link
Contributor

Important note here - node:8.2.1-alpine is not multi-arch and does not work on the RPi Zero/B, B+. node:8-alpine does work.

screen shot 2018-02-02 at 09 03 37

@StefanScherer
Copy link
Contributor

StefanScherer commented Feb 2, 2018

Thanks Alex. The 8.2.1 was perhaps before they started with node multi-arch images. node:8-alpine means node:8.9.4-alpine right now.

@RandomByte
Copy link
Contributor Author

Thanks all. I updated this PR to use Nodes LTS version 8 instead of 9.

I also went ahead and created #105 based on the discussion here. It removes the the need of the ARM-specific Dockerfile.
If #105 gets merged, this PR becomes obsolete.

@ManoMarks
Copy link
Contributor

Made obsolete by #105

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

Successfully merging this pull request may close these issues.

None yet

6 participants