This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-10
Channels
- # admin-announcements (1)
- # aleph (1)
- # asami (9)
- # babashka (30)
- # beginners (83)
- # calva (8)
- # cherry (4)
- # cider (4)
- # clj-kondo (15)
- # cljs-dev (11)
- # cljsrn (8)
- # clojure (85)
- # clojure-europe (87)
- # clojure-losangeles (9)
- # clojure-nl (4)
- # clojure-norway (4)
- # clojure-spec (3)
- # clojurescript (12)
- # community-development (5)
- # conjure (1)
- # core-typed (3)
- # datomic (21)
- # docker (13)
- # emacs (13)
- # funcool (1)
- # google-cloud (1)
- # graalvm (12)
- # gratitude (14)
- # holy-lambda (6)
- # introduce-yourself (18)
- # lsp (15)
- # malli (6)
- # matcher-combinators (15)
- # nbb (15)
- # off-topic (37)
- # pathom (31)
- # portal (23)
- # rdf (3)
- # releases (2)
- # reveal (2)
- # sci (4)
- # scittle (3)
- # shadow-cljs (14)
- # squint (2)
- # tools-deps (29)
I'm trying to cross-build an arm64 image using podman with podman build -t sample:latest -f deploy/Containerfile . --arch=arm64
.
My cross building environment works in general but now at the uberjar step I get:
[1/4] STEP 4/4: RUN clojure -T:build uber :uber-file '"target/app.jar"' :resource-dirs '["config" "resources"]'
Cloning:
Error building classpath. Cannot run program "git": error=0, Failed to exec spawn helper: pid: 66, exit value: 1
java.io.IOException: Cannot run program "git": error=0, Failed to exec spawn helper: pid: 66, exit value: 1
...
Any ideas?base image is clojure:tools-deps
and the whole Dockerfile works as expected when building for amd64
Not sure if it will work then - you need to use an arm64 image on your arm machine to build - that's why git executable doesn't work
I think I might be onto something about the arm64
images issue. Minimal POC:
Using podman (or docker), run a vanilla tools:deps (amd64) image:
podman run --rm -it clojure:tools-deps
In the spawned clojure repl, enter:
(require '[clojure.java.shell :as sh])(sh/sh "ls" "-la")
On the amd64 variant it returns:
user=> (require '[clojure.java.shell :as sh])(sh/sh "ls" "-la")
nil
{:exit 0, :out "total 0\ndrwxrwxrwt 1 root root 30 Nov 7 20:52 .\ndr-xr-xr-x 1 root root 18 Nov 10 20:36 ..\ndrwxr-xr-x 1 root root 2 Nov 10 20:36 hsperfdata_root\n", :err ""}
Running an arm64 image using:
podman run --arch=arm64 --rm -it clojure:tools-deps
Entering the same expression, it returns:
(require '[clojure.java.shell :as sh])(sh/sh "ls" "-la")
nil
This command is not for general use and should only be run as the result of a call to
ProcessBuilder.start() or Runtime.exec() in a java application
Execution error (IOException) at java.lang.ProcessImpl/forkAndExec (ProcessImpl.java:-2).
error=0, Failed to exec spawn helper: pid: 75, exit value: 1
I think @U06FS3DLH would know something about this.
hmm... not sure. my first thought is to make sure you run both of these commands since you're using a moving-target tag:
docker pull clojure:tools-deps
docker pull --platform=linux/amd64 clojure:tools-deps
(or --platform=linux/arm64
if your host is amd64)