-
Notifications
You must be signed in to change notification settings - Fork 594
Use multi-arch node base image #105
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
Use multi-arch node base image #105
Conversation
The main Dockerfile is now ARM-compatible
README.md
Outdated
@@ -45,26 +45,8 @@ $ docker service create \ | |||
dockersamples/visualizer | |||
``` | |||
|
|||
## Running on ARM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not remove this section. Someone will still have to build and maintain an image on the Docker Hub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't automatically make the image work on any architecture - it'll only work on the platform it's built on unless lots of additional work is done to make this an official library image where CI is done for each platform and pushed under a multi-stage image.
I'd recommend not merging this PR.
README.md
Outdated
|
||
[View on Docker Hub](https://hub.docker.com/r/alexellis2/visualizer-arm/tags/) | ||
## Supported architectures | ||
The main image is based on [node:8-alpine](https://hub.docker.com/_/node/). With that it already offers support for many architectures, including ARM (so it can run on your Raspberry Pi). See below for instructions on how to run on Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This chapter should be more clear how to build the image for another architecture.
I assume there will be still only the linux/amd64 image as dockersamples/visualizer
image.
So we need at least the docker build step how to build it locally and then use the commands above to start the visualizer.
5df2f52
to
f180e56
Compare
I see, sorry for the misunderstanding. I updated the readme to make it clearer what to do for any given architecture and especially how to build. Please let me know what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the good overview of all Linux architectures.
README.md
Outdated
@@ -61,7 +71,7 @@ $ docker service create \ | |||
If you would like to build the image from source run the following command: | |||
|
|||
``` | |||
$ docker build -f Dockerfile.arm -t visualizer-arm:latest . | |||
$ docker build -f Dockerfile -t visualizer-arm:latest . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can omit -f Dockerfile
here.
README.md
Outdated
|
||
To build an up-to-date image for any architecture supported by [node:8-alpine](https://hub.docker.com/_/node/) (currently `amd64`, `arm32v6`, `arm32v7`, `arm64v8`, `i386`, `ppc64le` and `s390x`), execute the following command on a device of your target architecture: | ||
``` | ||
$ docker build -f Dockerfile -t visualizer-custom:latest . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can omit -f Dockerfile
here.
README.md
Outdated
|
||
The main `dockersamples/visualizer` image supports **linux/amd64**. | ||
|
||
**For ARM**, there is a pre-built image available. See [Running on ARM](#running-on-arm). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be more specific about "arm" - this works for armhf
only, it won't work for 64-bit ARM such as that found on Packet's or Scaleway's servers or the Pine64 etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Done 👍
Any further objections @alexellis, @StefanScherer? |
Seems good to me. |
@alexellis any update from your side? |
@RandomByte I have some time to test your PR. Can you remove the Someone on a RPi Zero/1 can build it, someone else can use the same |
The build works as well as the visualizer on
One As mentioned above this one LGTM! @ManoMarks We can remove the |
Thanks @StefanScherer! |
As discussed in #102, change the main Dockerfile to use the muli-arch capable
node:8-alpine
image as base. This adds support for multiple architectures including ARM and makes some of the arch-specific Dockerfiles obsolete.I tested this on a MacBook and Rasperry Pi 3 (ARMv8) without issues. I therefore went ahead and removed the
Dockerfile.arm
file and corresponding readme documentation.If someone could confirm that the
Dockerfile.aarch64
file is obsolete as well, we can remove it too.I guess the Windows variant is still needed and could only be removed by adding build args to the main Dockerfile as @StefanScherer mentioned?
Btw. image size on Raspberry Pi is now down to 153MB (compared to 416MB with the old Dockerfile.arm)