docker-library / julia

Docker Official Image packaging for julia

Home Page:http://julialang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Packages are failing when I install them with the official Julia Docker

killah-t-cell opened this issue · comments

I am trying to build a Docker image for my package based on the official Julia image. Sadly, some packages always fail when being precompiled or instantiated. This prevents me from putting my package on a Docker container.

Here is my Dockerfile. Am I doing anything wrong or is this a bug?

FROM julia:latest

WORKDIR /app

ADD *.toml /app/
RUN julia --project=/app -e "using Pkg; Pkg.instantiate(); Pkg.precompile()"

ADD . /app

RUN julia --project=/app -e "using PackageName"

CMD ["julia", "--project=/app", "/app/src/PackageName.jl"]

Some packages that never fail locally are failing here.

Screenshot 2021-09-09 at 16 23 14

Please create a Minimal, Reproducible Example; Now the "*.toml" is missing.
and maybe in the https://discourse.julialang.org/ somebody can help you in debugging.

This Dockerfile is working for me - so no missing dependencies.

FROM julia:latest
RUN julia -e 'using Pkg; Pkg.add(["Quadrature"]);'
RUN julia -e 'using Pkg; Pkg.add(["DiffEqSensitivity"]);'
RUN julia -e 'using Pkg; Pkg.add(["DiffEqFlux"]);'
RUN julia -e 'using Pkg; Pkg.status();'
  ✓ Quadrature
  ✓ CUDA
  ✓ NNlibCUDA
  ✓ Flux
  ✓ OrdinaryDiffEq
  ✓ DiffEqCallbacks
  ✓ StochasticDiffEq
  ✓ ModelingToolkit
  ✓ DiffEqSensitivity
  ✓ GalacticOptim
  ✓ DiffEqFlux
  88 dependencies successfully precompiled in 593 seconds (97 already precompiled)
Removing intermediate container 094191436f34
 ---> 72b644c6e251
Step 5/5 : RUN julia -e 'using Pkg; Pkg.status();'
 ---> Running in c8da147218ac
      Status `~/.julia/environments/v1.6/Project.toml`
  [aae7a2af] DiffEqFlux v1.39.0
  [41bf760c] DiffEqSensitivity v6.49.1
  [67601950] Quadrature v1.10.0
Removing intermediate container c8da147218ac
 ---> e9e0c798bbc1
Successfully built e9e0c798bbc1
Successfully tagged jldeb:latest

Are you using the latest julia:latest image ?

$ docker pull julia:latest
latest: Pulling from library/julia
Digest: sha256:08b875bc9d121a25c2cb66989f8395b42ae8a58888f087d2d12a127034f87634
Status: Image is up to date for julia:latest
docker.io/library/julia:latest

$ docker images julia:latest
REPOSITORY   TAG       IMAGE ID       CREATED      SIZE
julia        latest    aa1a7d560fa8   6 days ago   487MB

Did you try the suggested way to see more errors from your screenshot? (Pkg.precompile())

In any case, I don't think this is necessarily a problem with the image so is probably better to ask on https://discourse.julialang.org/.

Turns out my Docker was out of memory so things failed. It now works perfectly. Thanks for the help.