This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-22
Channels
- # announcements (1)
- # beginners (109)
- # boot (2)
- # calva (26)
- # cider (6)
- # circleci (6)
- # cljsrn (3)
- # clojure (77)
- # clojure-dev (5)
- # clojure-europe (28)
- # clojure-finland (1)
- # clojure-hamburg (1)
- # clojure-italy (21)
- # clojure-japan (13)
- # clojure-nl (36)
- # clojure-spec (22)
- # clojure-sweden (4)
- # clojure-uk (105)
- # clojurescript (91)
- # community-development (8)
- # cursive (60)
- # datascript (3)
- # datomic (4)
- # emacs (33)
- # fulcro (19)
- # graalvm (38)
- # hoplon (4)
- # instaparse (1)
- # jobs (1)
- # leiningen (22)
- # off-topic (14)
- # pathom (2)
- # perun (4)
- # planck (5)
- # re-frame (10)
- # reagent (1)
- # reitit (11)
- # rum (11)
- # shadow-cljs (97)
- # tools-deps (82)
- # vim (53)
if I don’t want to build a --static
image, what should I copy to a Docker image in order for the binary to work?
Since it's based on llvm, I guess you could take any of the slim debian images https://hub.docker.com/_/debian and just add the binary?
Alpine isn't llvm but musl, although it appears you can get llvm on alpine as well https://pkgs.alpinelinux.org/package/v3.3/main/x86/llvm. Don't know much about it but ran into it trying to minimise a Rust image (which can be very small, as long as there is no c interop..)
I have been bitten by this in Python on alpine: https://superuser.com/questions/1219609/why-is-the-alpine-docker-image-over-50-slower-than-the-ubuntu-image
not sure if it affects substrate vm
I’ve already found something out. It can be done by using alpine
+ https://github.com/sgerrand/alpine-pkg-glibc
@gklijs @rahul080327 this seems to work (based on Alpine, I don’t know anything about LLVM vs MUSL)
Borkdude@michiel ~/Dropbox/dev/clojure/clj-kondo (master*) $ clj-kondo --lint src
...
linting took 305ms, errors: 0, warnings: 3
Borkdude@michiel ~/Dropbox/dev/clojure/clj-kondo (master*) $ docker run -v $PWD/src:/src borkdude/clj-kondo clj-kondo --lint /src
...
linting took 372ms, errors: 0, warnings: 4
This is my Docker image: https://github.com/borkdude/clj-kondo/blob/master/Dockerfile
I pushed it here: https://cloud.docker.com/repository/registry-1.docker.io/borkdude/clj-kondo
youre already compiling it here https://github.com/borkdude/clj-kondo/blob/master/Dockerfile#L19 right?
okay so the alpine is just to reduce the size
but since I’m not compiling it to a static binary, it needs those libc libraries at the bottom still
(the reason I’m not compiling to static is that it doesn’t work on Mac and I’d like to keep the script the same - although I could change that)
i guess this is the only solution then. maybe having a static build against musl might reduce it a bit more but i dont anticipate much
the aim here is only to reduce the image size?
linting my whole project takes the same amount of time in Docker as on Mac natively, so I think it’s good now
yeah i dont think there is any other option.
yep 🙏:skin-tone-3:
im just a bit wary of some perf surprises alpine had for me. but they were long running stuff and hit the GC mostly. this should be okay
that scarred me into using plain debian images 😛
maybe some tens of MB
but you wont have stuff like GCC
installing that is a time/space waste again
yeah mostly should be fine. i assume clj kondo doesnt allocate multi gigabyte heaps 😛