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

Failed to build Docker image on ARM architecture #136

Closed
karelmaxa opened this issue Nov 14, 2022 · 5 comments
Closed

Failed to build Docker image on ARM architecture #136

karelmaxa opened this issue Nov 14, 2022 · 5 comments
Assignees

Comments

@karelmaxa
Copy link
Member

Building of Docker image on ARM architecture (MacBook PRO with M1 chip in this case) fail with the following error:

#14 83.17 [INFO] --- frontend-maven-plugin:1.12.0:npm (npm-install) @ openidm-ui-admin ---
#14 83.17 [INFO] Running 'npm install' in /project/openidm-ui/openidm-ui-admin
#14 91.36 [INFO]
#14 91.36 [INFO] > puppeteer@4.0.1 install /project/openidm-ui/openidm-ui-admin/node_modules/puppeteer
#14 91.36 [INFO] > node install.js
#14 91.36 [INFO]
#14 91.46 [INFO] The chromium binary is not available for arm64:
#14 91.46 [INFO] If you are on Ubuntu, you can install with:
#14 91.46 [INFO]
#14 91.46 [INFO]  apt-get install chromium-browser
#14 91.46 [INFO]
#14 91.46 [INFO] /project/openidm-ui/openidm-ui-admin/node_modules/puppeteer/lib/BrowserFetcher.js:112
#14 91.46 [INFO]             throw new Error();
#14 91.46 [INFO]             ^
#14 91.46 [INFO]
#14 91.46 [INFO] Error
#14 91.46 [INFO]     at /project/openidm-ui/openidm-ui-admin/node_modules/puppeteer/lib/BrowserFetcher.js:112:19
#14 91.46 [INFO]     at FSReqCallback.oncomplete (fs.js:192:21)
#14 91.63 [INFO] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
#14 91.63 [INFO] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})
#14 91.63 [INFO]
#14 91.68 [INFO] npm ERR! code ELIFECYCLE
#14 91.68 [INFO] npm ERR! errno 1
#14 91.68 [INFO] npm ERR! puppeteer@4.0.1 install: `node install.js`
#14 91.68 [INFO] npm ERR! Exit status 1
#14 91.68 [INFO] npm ERR!
#14 91.68 [INFO] npm ERR! Failed at the puppeteer@4.0.1 install script.
#14 91.68 [INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#14 91.71 [INFO]
#14 91.71 [INFO] npm ERR! A complete log of this run can be found in:
#14 91.71 [INFO] npm ERR!     /root/.npm/_logs/2022-11-09T12_28_18_901Z-debug.log
karelmaxa added a commit to karelmaxa/wrenidm that referenced this issue Nov 23, 2022
pavelhoral added a commit that referenced this issue Nov 23, 2022
Fix build of Docker image on arm64 (#136)
@karelmaxa
Copy link
Member Author

Fix in #138.

@karelmaxa karelmaxa self-assigned this Dec 1, 2022
@karelmaxa
Copy link
Member Author

karelmaxa commented Dec 15, 2022

Issue is still not fixed because Maven's Alpine-based Docker image is not available for arm64.

@karelmaxa karelmaxa reopened this Dec 15, 2022
karelmaxa added a commit to karelmaxa/wrenidm that referenced this issue Jan 3, 2023
pavelhoral added a commit that referenced this issue Jan 3, 2023
Remove arm64 platform from publish pipeline (#136)
@karelmaxa
Copy link
Member Author

karelmaxa commented Jan 3, 2023

The issue cannot be easily fixed in this moment. We need Chrome / Chromium for FE tests executed through Puppeteer. Puppeteer itself is not able to install arm64 based Chromium (see puppeteer/puppeteer#7740). So i tried to install Chrome / Chromium in project-build Docker stage manually but there are some issues :

  • Ubuntu-based (version 22.04) Docker Image (3.8.7-eclipse-temurin-17)
    • Chromium –⁠ version installed from the official Ubuntu repository cannot be executed because it requires snap (Error: Command '/usr/bin/chromium-browser' requires the chromium snap to be installed), but snap is not working in Docker environment
    • Chrome –⁠ Chrome for Ubuntu 22.04 and arm64 architecture is not available (the latest supported version was published for Ubuntu 18.04)
  • Alpine-based Docker Image (3.8.7-eclipse-temurin-17-alpine)

There are some third-party repositories with prebuilt Chrome browser for Ubuntu 22.04 and arm64 architecture but there is no guarantee of stability.

@pavelhoral
Copy link
Member

As this is only issue for the build stage I think we can go for Debian's Slim image and use OpenJDK package instead of Temurin. I hope there shouldn't be a problem with Chromium / Snap as well.

karelmaxa added a commit to karelmaxa/wrenidm that referenced this issue Jan 12, 2023
pavelhoral added a commit that referenced this issue Jan 12, 2023
Use Debian-based image for build stage (#136).
@karelmaxa
Copy link
Member Author

Fixed in #146. We are using Debian's Slim image with manually installed OpenJDK, Maven and Chromium. Docker Image is buildable on Apple's M1 chip.

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

No branches or pull requests

2 participants