Open beaverden opened 3 years ago
Here is Dockerfile for arm64 which works for me, I don't know for sure that build-pdf works but I assume it does, and it's less ugly.
@paskal I'm not sure why do you think it's less ugly, since you have, alongside your dockerfile, a docker-compose file that's twice the length, with hardcoded paths which does not properly represent services, but commands. And a sed
to top it all up
I posted the Dockerfile since I spent a significant amount of time making chromium work on arm64 and the export
option actually uses chromium to create a pdf. If you know a solution that makes the export command work under arm64 or have actual working (and tested) solutions that are better and more readable, please contribute by sharing them.
Thanks @beaverden, looks great, do you want to throw it up in a PR and we can continue discussion there?
I think this is a temporary solution since chromium builds should be available out of the box for arm64 at some point. I could make a PR for some documentation update as a temporary solution. CC @thomasdavis
Thanks @beaverden !
I build the image with the command docker build . -t [name]
.
Now how can I use it?
Thank you for your help!
Hello, @riccio82
I am using the following makefile
clean:
rm -rf build
init:
docker build --target init -o build .
pdf:
docker build --target build-pdf --build-arg THEME=$(THEME) -o build .
server:
docker build --target serve --build-arg THEME=$(THEME) -t resume-server .
docker run --rm -p 4000:4000 -it resume-server
I am from my phone so can't check it, but the theme option might not be included in the dockerfile mentioned above, but the general gist is clear
Details here: https://github.com/beaverden/resume
Hey - it seems as though Chromium ARM64 builds are now available 👀
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 5c602003f to 48bbc53fb.
Updated 9 taps (cloudflare/cloudflare, homebrew/core, homebrew/cask, homebrew/bundle, homebrew/cask-fonts, homebrew/services, dart-lang/dart, sass/sass and twilio/brew).
==> New Formulae
bat-extras jpdfbookmarks microsocks selene vespa-cli
dart-lang/dart/dart@2.13 librist osc-cli solana viu
==> Updated Formulae
Updated 394 formulae.
==> New Casks
epilogue-operator mathcha-notebook nimblenote remotion
==> Updated Casks
Updated 209 casks.
==> Downloading https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac_Arm/920567/chrome-mac.zip
######################################################################## 100.0%
==> Installing Cask chromium
==> Moving App 'Chromium.app' to '/Applications/Chromium.app'
==> Linking Binary 'chromium.wrapper.sh' to '/opt/homebrew/bin/chromium'
🍺 chromium was successfully installed!
Still doesn't work with npm install -g resume-cli
however 😞
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
npm ERR! code 1
npm ERR! path /Users/aaroncarson/.nvm/versions/node/v14.17.6/lib/node_modules/resume-cli/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! The chromium binary is not available for arm64:
npm ERR! If you are on Ubuntu, you can install with:
npm ERR!
npm ERR! apt-get install chromium-browser
npm ERR!
npm ERR! /Users/aaroncarson/.nvm/versions/node/v14.17.6/lib/node_modules/resume-cli/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112
npm ERR! throw new Error();
npm ERR! ^
npm ERR!
npm ERR! Error
npm ERR! at /Users/aaroncarson/.nvm/versions/node/v14.17.6/lib/node_modules/resume-cli/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112:19
npm ERR! at FSReqCallback.oncomplete (fs.js:192:21)
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/aaroncarson/.npm/_logs/2021-09-14T23_19_03_527Z-debug.log```
I think updating the puppeteer dependency resolves this
https://github.com/puppeteer/puppeteer/issues/6622#issuecomment-906476717
FYI, in order to solve this issue on my M1 Mac, I nvm use
a version of Node that I have installed with rosetta2.
Cf https://gist.github.com/adrienjoly/e29a6e73fb7e701eefd80ff9bde9abeb#solution for instructions.
I think updating the puppeteer dependency resolves this
Bump on this: because https://github.com/puppeteer/puppeteer/pull/7099 is closed, I think you would just need to update: https://github.com/jsonresume/resume-cli/blob/21d15f6feb58b689abdb0c740b07319cf5fc2133/package.json#L44 to the latest version
https://github.com/jsonresume/resume-cli/pull/730 might fix this, when merged
I tried to create a working build for
resume export
, so it also works on arm64 (where chrome fails to download), here is how I made it workhttps://gist.github.com/beaverden/e8e9dead457eeb224afd71d86b032b00