docker-library / julia

Docker Official Image packaging for julia

Home Page:http://julialang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build package does not work

johnson2427 opened this issue · comments

Honestly, the biggest issue is I cannot really find any documentation on this. So here it goes.

I have a package that I developed in Julia called Ares.jl. Under Ares.jl I have a Manifest.toml and Project.toml as well as my Dockerfile. Then I have a src file. If I attempt to install and run locally, I do it by the following commands.

cd /to/my/Ares.jl
julia
using Ares
using Pkg
Pkg.activate()
Pkg.build()
Ares.startRestServer()

My Dockerfile looks like this:

FROM julia:latest

COPY . /

WORKDIR /Ares.jl

RUN julia -e 'using Pkg; Pkg.activate("."); Pkg.instantiate; Pkg.build(); Pkg.resolve();'
RUN julia -e 'using Ares;'

CMD ["julia", "Ares.startRestServe()r"]

This is telling me that Ares cannot be found

 > [5/5] RUN julia -e 'using Ares':
#9 0.437 ERROR: ArgumentError: Package Ares not found in current path:
#9 0.821 - Run `import Pkg; Pkg.add("Ares")` to install the Ares package.
#9 0.821 
#9 0.821 Stacktrace:
#9 0.821  [1] require(into::Module, mod::Symbol)
#9 0.997    @ Base ./loading.jl:967
------
executor failed running [/bin/sh -c julia -e 'using Ares']: exit code: 1
ERROR: Service 'ares' failed to build : Build failed

And without RUN julia -e 'using Ares';, I receive this response:

ERROR: SystemError: opening file "/Ares.jl/Ares.startRestServer()": No such file or directory

Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:174
  [2] #systemerror#68
    @ ./error.jl:173 [inlined]
  [3] systemerror
    @ ./error.jl:173 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open
    @ ./iostream.jl:282 [inlined]
  [6] open(f::Base.var"#364#365"{String}, args::String; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:328
  [7] open
    @ ./io.jl:328 [inlined]
  [8] read
    @ ./io.jl:436 [inlined]
  [9] _include(mapexpr::Function, mod::Module, _path::String)
    @ Base ./loading.jl:1249
 [10] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
 [11] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:292
 [12] _start()
    @ Base ./client.jl:495

Any help would be amazing, thank you in advance!

You need to either use Pkg.activate in every process, or start the process with the --project flag. Since this is not a docker issue it would be better to direct questions like this to the Julia forum: https://discourse.julialang.org/

You need to either use Pkg.activate in every process, or start the process with the --project flag. Since this is not a docker issue it would be better to direct questions like this to the Julia forum: https://discourse.julialang.org/

thank you!

Closing since this is resolved
In the future you could also try asking over at the Docker Community Forums, Docker Community Slack, or Stack Overflow. Since these repos aren't really a user-help forum