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

clojurescript variants that have nodejs pre-installed? #91

Open
cap10morgan opened this issue Jun 26, 2020 · 10 comments
Open

clojurescript variants that have nodejs pre-installed? #91

cap10morgan opened this issue Jun 26, 2020 · 10 comments

Comments

@cap10morgan
Copy link
Collaborator

Should we consider adding clojurescript images that pre-install node, npm, etc.?

@njordhov
Copy link

njordhov commented Jul 5, 2020

Yes! I am currently using a custom Dockerfile for ClojureScript development that builds on the clojure image to pre-install nodejs. I'd rather skip the Dockerfile and have the complete setup in docker-compose. It would be great if clojure:latest have nodejs pre-installed, providing a kitchen-sink image for clojure(script) development.

@cap10morgan
Copy link
Collaborator Author

@njordhov Hmm... interesting idea. I was thinking of just creating official clojurescript images with all the other tags we generate but with latest LTS node / npm stuff pre-installed and the latest clojurescript pre-downloaded. And then clojurescript:latest would have lein, boot, and tools-deps stuff pre-installed like we recently started doing with clojure:latest. What do you think of that?

Thoughts @Quantisan?

@Quantisan
Copy link
Owner

@cap10morgan a separate image sounds good to keep it clean. Otherwise, I haven't used clojurescript for ages so I don't know what toolsets are needed anymore.

@njordhov
Copy link

njordhov commented Jul 9, 2020

@cap10morgan A separate clojurescript image is fine, particularly when going beyond a kitchen-sink image. Thank you for all your work in making this happen.

@souenzzo
Copy link

Please no; AFIK there is no cljs builder that uses node in process.

You just need the node_modules folder.

Just do like this:

FROM node:alpine AS node
COPY package.json package-lock.json ./
RUN npm install

FROM openjdk-16-tools-deps-alpine
COPY --from=node node_modules node_modules
RUN clojure -A:shadow-cljs release app 

@cap10morgan
Copy link
Collaborator Author

@souenzzo That's an argument for why you don't need it (not why it would be undesirable nor why others shouldn't need it). If we created it and you still didn't need it, you could just not use it. The other images aren't going away.

@call-a3
Copy link

call-a3 commented Oct 1, 2020

@souenzzo I still have a use-case for this, using leiningen/fighweel-main which uses webpack for post-processing/bundling.

@nivekuil
Copy link

Came here from @plexus's tip on thheller/shadow-cljs#579. The fix is just:

FROM docker.io/clojure:temurin-18-tools-deps-focal
RUN apt-get update; apt-get -y install nodejs

I've pushed it to docker.io/nivekuil/clojure-with-node for the lazy.

@cap10morgan
Copy link
Collaborator Author

This is still something I'd like to do. I think it will involve changing some fundamental assumptions in our build system, so the work involved there is the big hurdle.

@lread
Copy link

lread commented Apr 21, 2024

Tangental tip for those using the clojure docker image with CircleCI and wanting to add nodejs support: you can add nodejs easily enough with their node orb. Here's how I did this for cljdoc's build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants