-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
112 lines (87 loc) · 3.98 KB
/
Dockerfile
File metadata and controls
112 lines (87 loc) · 3.98 KB
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
# See https://github.com/phusion/baseimage-docker/blob/master/Changelog.md
# Based on Ubuntu 18.04 since v0.11
FROM phusion/baseimage:0.11
#FROM continuumio/miniconda3:latest
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
RUN apt-get update --fix-missing && \
apt-get install -y wget bzip2 ca-certificates curl git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda clean -tipsy && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
# This file is automatically generated from tpl.Dockerfile
# FROM intelpython3_core
USER root
ENV ACCEPT_INTEL_PYTHON_EULA=yes
RUN conda config --add channels intel\
&& conda install -y -q intelpython3_core python=3 \
&& conda clean --all \
&& apt-get update -qqq \
&& apt-get install -y -q g++ \
&& apt-get autoremove
# Add switch mirror to fix the issue
# https://github.com/aiidalab/aiidalab-docker-stack/issues/9
RUN echo "deb http://mirror.switch.ch/ftp/mirror/ubuntu/ bionic main \ndeb-src http://mirror.switch.ch/ftp/mirror/ubuntu/ bionic main \n" >> /etc/apt/sources.list
# install debian packages
# Note: prefix all 'apt-get install' lines with 'apt-get update' to prevent failures in partial rebuilds
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
tzdata
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
graphviz \
libpq-dev \
libgirepository1.0-dev\
libcairo2-dev \
pkg-config \
gir1.2-gtk-3.0 \
ssh &&\
rm -rf /var/lib/apt/lists/* \
&& apt-get clean all
# update build-tools
RUN pip install -U pip
RUN pip install cython setuptools wheel tk psycopg2 PyGobject pycairo cython
# launch start-singleuser
COPY opt/start-singleuser.sh /opt/start-singleuser-base.sh
COPY my_init.d/start-singleuser.sh /etc/my_init.d/30_start-singleuser.sh
# Install AiiDA and BigDFT plugin
# aiida from gh, as we have numpy 1.17 in intelpython. Replace by pip one after 1.0.2 release.
RUN git clone https://github.com/aiidateam/aiida-core.git
RUN pip install -e aiida-core['rest','atomic_tools','notebook']
EXPOSE 8888
# Add aiida user (no password)
RUN mkdir /home/aiida && \
useradd --home /home/aiida --uid 1234 --shell /bin/bash aiida && \
chown -R aiida:aiida /home/aiida
# Add .bashrc file to the aiida user
RUN cp -v /etc/skel/.bashrc /etc/skel/.bash_logout /etc/skel/.profile /home/aiida/
RUN echo ". /opt/conda/etc/profile.d/conda.sh" >> /home/aiida/.bashrc
RUN echo "conda activate base" >> /home/aiida/.bashrc
RUN echo 'eval "$(verdi completioncommand)"' >> /home/aiida/.bashrc
RUN echo 'export PYTHONPATH="/home/aiida"' >> /home/aiida/.bashrc
RUN echo 'export PATH=$PATH:"/home/aiida/.local/bin"' >> /home/aiida/.bashrc
RUN chown -R aiida:aiida /home/aiida
# Install rest of the packages as normal user
USER aiida
# Populate reentry cache for aiida user https://pypi.python.org/pypi/reentry/
RUN reentry scan
# Set $HOME, create git directory
ENV HOME /home/aiida
ENV PATH /opt/conda/bin:$PATH
# Make ssh dir and create host entry for bitbucket.org
RUN mkdir --mode=0700 $HOME/.ssh/ && \
touch $HOME/.ssh/known_hosts
RUN mkdir -p $HOME/.ipython/profile_default/startup && cp aiida-core/aiida/tools/ipython/aiida_magic_register.py /home/aiida/.ipython/profile_default/startup/aiida_magic_register.py
# Important to end as user root!
USER root
# Specify landing folder when login to the docker container
WORKDIR $HOME
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
#EOF