-
Notifications
You must be signed in to change notification settings - Fork 26
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
[proposal] Add node and yarn installation logic to dockerfile, bump ruby to 3.3.6, bump rails to 8.0.0 #23
base: main
Are you sure you want to change the base?
Conversation
Do we need to care about different node and yarn versions given we are just creating the application with those Dockerfiles? I think we should just hardcoded a single version of it. |
Sure, this also makes sense. I'll redo it later today |
Next round of changes ready for review |
Hey @onshi, I'm getting the following on macOS Sonoma 14.6.1. ± ./target/debug/rails-new main --js esbuild --css tailwind
[+] Building 0.7s (6/7) docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 727B 0.0s
=> [internal] load metadata for docker.io/library/ruby:3.3.4 0.5s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/4] FROM docker.io/library/ruby:3.3.4@sha256:d4233f4242ea25346f157709bb8417c615e7478468e2699c8 0.0s
=> CACHED [2/4] RUN curl -fsSL https://nodejs.org/dist/v22.6.0/node-v22.6.0-linux-x64.tar.gz 0.0s
=> ERROR [3/4] RUN npm install -g yarn@1.22.22 0.1s
[3/4] RUN npm install -g yarn@1.22.22:
0.107 rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
0.107 Trace/breakpoint trap
Dockerfile:14 Could this be an issue just on my machine? |
Hey @nkruk, oh boy I think rosetta error would indicate that you're using arm processor? I currently have only Intel x86 based computers so I didn't test my changes on this architecture ;/ Can you let me know if running softwareupdate --install-rosetta changes anything for you? If it doesn't I can try to rewrite our Dockerfiles to install node using different approach. Cheers! |
Yes @onshi, I'm running an M2 Pro and had already ran Install of Rosetta 2 finished successfully But same output. |
Hey @nkruk, I see. I rewrote node installation logic in our Dockerfiles to use Cheers! |
Hey @onshi: worked like a charm! Hope it gets merged soon. Thanks! |
@onshi it worked fine for me as well. Thanks! |
Any holdback on release of this? ❤️ |
@onshi would you mind giving a tip on how I can run your fork? |
@rafaelfranca you the only maintainer here or? |
@NielsKSchjoedt sure, I'm assuming you've rust and cargo installed. This way you can just point cargo to install from my fork cargo install --verbose --git https://github.com/onshi/rails-new --branch issues_22 binary will be installed in your cheers! |
update: last commit bumped default ruby to tested with ./target/debug/rails-new main --js esbuild --css tailwind docker run -it --rm -v $(pwd)/main:/rails -w /rails -p 3000:3000 -e BINDING=0.0.0.0 rails-new-3.3.6-8.0.0 /bin/bash -c "bundle install && ./bin/dev" docker run -it --rm -v $(pwd)/main:/rails -w /rails -p 3000:3000 -e BINDING=0.0.0.0 rails-new-3.3.6-8.0.0 /bin/bash
root@b9f3d4a1f2d4:/rails# ruby --version
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-linux]
root@b9f3d4a1f2d4:/rails# rails --version
Rails 8.0.0
root@b9f3d4a1f2d4:/rails# node --version
v22.11.0
root@b9f3d4a1f2d4:/rails# yarn --version
1.22.22 open http://localhost:3000 |
This PR addresses issue #22
Currently our
Dockerfile
image doesn't havenode
andyarn
binaries which results in errors when using--js
or--css
switches.This PR adds logic for downloading
node 22.7.0
binary and installingyarn 1.22.22
to our dockerfiles. It also bumps defaultruby
to3.3.5
and defaultrails
to7.2.1
How this was tested?
@rafaelfranca, @excid3 let me know what do you think, I'm open to rewritting this PR to your prefered approach