Johnny Chen cb90bfa7b6
[julia] upgrade to StorageMirrorServer v0.2.0
HTTP.jl is somehow not reliable enough that `HTTP.get` would occasionally hang for unidentified reasons. This version uses `curl` instead of `HTTP.get` to fetch resources, which is more stable and faster.

`curl` dependency is included in julia:1.5 base image so we don't need to install it.
2020-09-10 15:54:23 +08:00

25 lines
1.1 KiB
Docker

# For the details and usage of this docker script, please refer to:
# * https://github.com/tuna/tunasync-scripts/pull/71
# * https://github.com/tuna/issues/issues/837
# StorageServer.jl is used to set up a *static* storage server for julia packages, it requires at least Julia 1.4
# The details of the storage protocol can be found in https://github.com/JuliaLang/Pkg.jl/issues/1377
FROM julia:1.5
LABEL description="A community maintained docker script to set up julia mirror easily."
LABEL maintainer="Johnny Chen <johnnychen94@hotmail.com>"
ENV JULIA_DEPOT_PATH="/opt/julia"
RUN adduser --uid 2000 tunasync && \
julia -e 'using Pkg; pkg"add StorageMirrorServer@0.2.0"' && \
chmod a+rx -R $JULIA_DEPOT_PATH
# Julia doesn't not yet have a nice solution for centralized package system with preinstalled
# packages. Here we provide a system-wide startup.jl that modifies the DEPOT_PATH and LOAD_PATH
# variables for each user.
# For more information about this, please refer to https://github.com/JuliaLang/Pkg.jl/issues/1952
COPY dockerfiles/julia/startup.jl /usr/local/julia/etc/julia/startup.jl
WORKDIR /julia
CMD /bin/bash