forked from brndnmtthws/ijulia-notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
113 lines (102 loc) · 4.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#name of container: docker-ijulia-notebook
#versison of container: 0.6.3
FROM quantumobject/docker-baseimage:18.04
MAINTAINER Alun ap Rhisiart "coding@alunaprhisiart.uk"
# Update the container
# Installation of nesesary package/software for this containers...
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends apt-utils \
git \
bzip2 \
unzip \
libcairo2-dev libpango1.0-0 libpango1.0-dev zlib1g-dev tk-dev tcl-dev \
glib2.0 \
file \
ca-certificates \
libsm6 \
pandoc \
texlive \
libxrender1 \
gfortran \
gcc \
fonts-dejavu \
libglib2.0-dev \
librsvg2-dev \
libpixman-1-dev \
hdf5-tools \
glpk-utils \
libnlopt0 \
imagemagick \
inkscape \
gettext \
libreadline-dev \
libncurses-dev \
libpcre3-dev \
libgnutls28-dev \
tmux \
pkg-config \
pdf2svg \
libc6 \
libc6-dev \
software-properties-common \
coinor-* libtool \
libffi-dev \
libssl-dev \
libzmq3-dev \
libsundials-cvodes2 \
libsundials-ida2 \
libnlopt-dev \
openmpi-bin \
libopenmpi-dev \
libblosc-dev \
ffmpeg tzdata\
libgmp-dev libglpk-dev \
libmumps-dev \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/* \
&& rm -rf /var/lib/apt/lists/*
# Julia dependencies
# install Julia packages in /opt/julia instead of $HOME
ENV JULIA_PKGDIR=/opt/julia
ENV JULIA_VERSION=1.5.3
RUN mkdir /opt/julia-${JULIA_VERSION} && \
cd /tmp && \
wget -q https://julialang-s3.julialang.org/bin/linux/x64/`echo ${JULIA_VERSION} | cut -d. -f 1,2`/julia-${JULIA_VERSION}-linux-x86_64.tar.gz && \
echo "f190c938dd6fed97021953240523c9db448ec0a6760b574afd4e9924ab5615f1 *julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - && \
tar xzf julia-${JULIA_VERSION}-linux-x86_64.tar.gz -C /opt/julia-${JULIA_VERSION} --strip-components=1 && \
rm /tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz
RUN ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia
# Configure environment
ENV CONDA_DIR /opt/conda
ENV PATH $CONDA_DIR/bin:$PATH
ENV CONDA_JL_HOME $CONDA_DIR/conda_jl
ENV SHELL /bin/bash
# Show Julia where conda libraries are \
RUN mkdir /etc/julia && \
echo "push!(Libdl.DL_LOAD_PATH, \"$CONDA_DIR/lib\")" >> /etc/julia/juliarc.jl && \
mkdir $JULIA_PKGDIR
##startup scripts
#Pre-config scrip that maybe need to be run one time only when the container run the first time .. using a flag to don't
#run it again ... use for conf for service ... when run the first time ...
RUN mkdir -p /etc/my_init.d
COPY startup.sh /etc/my_init.d/startup.sh
RUN chmod +x /etc/my_init.d/startup.sh
##Adding Deamons to containers
RUN mkdir /etc/service/ijulia
COPY ijulia.sh /etc/service/ijulia/run
RUN chmod +x /etc/service/ijulia/run
#pre-config scritp for different service that need to be run when container image is create
#maybe include additional software that need to be installed ... with some service running ... like example mysqld
COPY pre-conf.sh /sbin/pre-conf
RUN chmod +x /sbin/pre-conf ; sync \
&& /bin/bash -c /sbin/pre-conf \
&& rm /sbin/pre-conf
#add files and script that need to be use for this container
#include conf file relate to service/daemon
#additionsl tools to be use internally
COPY after_install.sh /sbin/after_install
RUN chmod +x /sbin/after_install
# to allow access from outside of the container to the container service
# at that ports need to allow access from firewall if need to access it outside of the server.
EXPOSE 8998
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]