Skip to content

Fix arm docker build#14522

Merged
jryans merged 3 commits intoelement-hq:developfrom
mattcen:fix-arm-docker-build
Jul 31, 2020
Merged

Fix arm docker build#14522
jryans merged 3 commits intoelement-hq:developfrom
mattcen:fix-arm-docker-build

Conversation

@mattcen
Copy link
Copy Markdown
Contributor

@mattcen mattcen commented Jul 16, 2020

History is at: https://matrix.to/#/!YTvKGNlinIzlkMTVRl:matrix.org/$4Se7Bpo2lakGZLGxnsXA8WQlCHtMLrJRs8qiNshzBKA?via=matrix.org&via=privacytools.io&via=mozilla.org
(Transcript below)

In short, trying to build an Arm binary of the Docker image for riot-web on either a Raspberry Pi 3 or a MacBook via Docker buildx, there are no pre-built binaries available for canvas, and building it causes webpack to run out of memory. These two commits seem to rectify these issues.

Chat transcript

Matt Cengia (he/him/his)

Hey folks, I'm trying to get Riot installed, via Docker, onto a Raspberry Pi 3. When I try to build the Docker image, either on my RPi, or on an emulated Arm container on my Mac via docker buildx, I get an error about 'canvas'. I'm building v1.6.7, and when I try to build the same image as an amd64 image, it works fine. Any ideas what's going on? Here's a gist of the error I get (I tried manually stepping through the Docker container build to debug it):
https://gist.github.com/cac6efa0e9730ae84397a6fad9a9609d

Michael (t3chguy)

Matt Cengia (he/him/his): #14400 (comment)

Matt Cengia (he/him/his)

Ah, right. Thanks, Michael (t3chguy) . Is this something for which I could propose a patch to the Dockerfile?

Michael (t3chguy)

Sure

mattcen added 2 commits July 16, 2020 16:21
When building the Docker image on amd64, canvas can be installed
from a pre-built binary. When building on an another architecture,
however, such as arm (e.g. on a Raspberry Pi), these binaries need to be
built locally, as per https://www.npmjs.com/package/canvas#compiling.
These added dependencies facilitate this. See also, issue element-hq#14400.

Signed-off-by: Matt Cengia <mattcen@mattcen.com>
When trying to build the Docker image, I kept receiving an out-of-memory
error from Webpack. This issue is apparently explained at
webpack/webpack#1914.
Several comments in the issue suggested using Node 12 or above. Doing so
resolved this issue for me.

Signed-off-by: Matt Cengia <mattcen@mattcen.com>
@t3chguy t3chguy requested a review from a team July 16, 2020 06:26
Comment thread Dockerfile
@jryans
Copy link
Copy Markdown
Collaborator

jryans commented Jul 31, 2020

@mattcen Just a nudge to add a comment as mentioned above, and then we should be ready to merge this. Thanks for working on it!

@mattcen
Copy link
Copy Markdown
Contributor Author

mattcen commented Jul 31, 2020

@jryans Ah, sorry, I missed your last comment about this; have just pushed another commit with a comment in it.

Signed-off-by: Matt Cengia <mattcen@mattcen.com>
@mattcen mattcen force-pushed the fix-arm-docker-build branch from 8add0e9 to 86185e8 Compare July 31, 2020 12:27
Copy link
Copy Markdown
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@jryans jryans merged commit 7e3527f into element-hq:develop Jul 31, 2020
@mattcen mattcen deleted the fix-arm-docker-build branch September 21, 2020 06:23
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.

2 participants