Created
July 5, 2018 13:46
-
-
Save quinnj/169a2d712ab8f780e56772ed88867d3a to your computer and use it in GitHub Desktop.
Base Julia Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stretch-slim | |
# Create the home directory for the new user. | |
RUN mkdir -p /home/default | |
# Create an default user so our program doesn't run as root. | |
RUN groupadd -r default &&\ | |
useradd -r -g default -d /home/default -s /sbin/nologin -c "Docker image user" default | |
# Set the home directory to our default user's home. | |
ENV HOME=/home/default | |
RUN apt-get update && apt-get install -y curl tar procps net-tools | |
RUN curl -L -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 | |
RUN chmod +x /usr/local/bin/dumb-init | |
WORKDIR /usr/local | |
# bump JULIA_DOCKER_VERSION to force rebuild of nightly binary download | |
ENV JULIA_DOCKER_VERSION 1 | |
COPY Manifest.toml Manifest.toml | |
COPY Project.toml Project.toml | |
# download, unpack nightly julia binary | |
RUN curl https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-linux64.tar.gz > julia.tar.gz && \ | |
mkdir julia && \ | |
tar xzf julia.tar.gz -C julia && \ | |
mv julia/$(cd julia; echo *)/* julia/ && \ | |
rm julia.tar.gz && \ | |
rm -rf julia/share/doc && \ | |
rm -rf julia/share/julia/test && \ | |
rm julia/lib/julia/sys-debug.so && \ | |
rm julia/lib/libjulia-debug.so.0.7.0 && \ | |
find . -type f -name '*.cov' -delete && \ | |
find . -type f -name '*.mem' -delete && \ | |
rm julia/LICENSE.md && rm julia/bin/julia-debug && \ | |
rm -rf julia/etc && rm -rf julia/include && \ | |
rm -rf julia/share/appdata && rm -rf julia/share/applications && \ | |
rm -rf julia/share/icons && rm -rf julia/share/man && \ | |
rm julia/lib/libjulia-debug.so && rm julia/lib/libjulia-debug.so.0.7 && \ | |
mv julia/bin/* bin/ && \ | |
mv julia/lib/* lib/ && \ | |
mv julia/share/* share/ && \ | |
rm -rf julia | |
RUN chown -R default:default $HOME | |
# Change to the default user. | |
USER default | |
# force compilation of external, shared packages copied in from Manifest.toml./Project.toml | |
RUN /usr/local/bin/julia -e 'using Pkg; Pkg.instantiate()' && \ | |
/usr/local/bin/julia -e 'using HTTP' | |
CMD /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment