I'm wondering if it's possible to run arbitrary julia code via the command like similar to python:
python -c "print('stuff')"
or in R:
R -e '# do stuff'
because I'm building a docker container I'd like to be able to do something as shown above for Julia, currently I think I might be able to work around it like so:
&& echo 'packs=["Distributions", "CSV", "DataFrames", "ForwardDiff", "PyCall", "GLM"];for i in packs;Pkg.add(i);end' >> packs.jl \
&& julia packs.jl \
in the dockerfile, but then I wonder what if packages ask for permission like cario for example
The following seems to work in Julia 0.6:
julia -e 'Pkg.add("DifferentialEquations.jl")'
With Julia 0.7-beta, it looks like you should do
julia -e 'using Pkg; Pkg.add("DifferentialEquations.jl")'
For multiple packages, you can use the dot suffix and provide a list.
Pkg.add.(["DifferentialEquations.jl", "Optim.jl"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With