Dockerfile 3.93 KB
Newer Older
Michele Compostella's avatar
Michele Compostella committed
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
#####################################################################################################
## Copyright (C) 2020 Udo von Toussaint, F. J. Dominguez-Gutierrez, Markus Rampp, Michele Compostella
##              Max-Planck-Institut für Plasmaphysik, Boltzmannstrasse 2, 85748 Garching, Germany
##              Max-Planck Computing and Data Facility, Giessenbachstrasse 2, 85748 Garching, Germany
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
##
#####################################################################################################
##
## General Notes:
## Docker file for Fingerprinting and Visualizing defects in damaged crystal structures
## Version: 1.0
## This software provides a workflow for fingerprinting and visualizing defects in damaged crystal 
## structures. The theoretical background is presented in: paper_ID
##
#####################################################################################################

# Importing Ubuntu image
FROM ubuntu:18.04

# Updating distro
RUN \
  apt-get update && \
  apt-get upgrade -y

# Installing basic packages
RUN \
Michele Compostella's avatar
Michele Compostella committed
41
  apt-get install -y apt-utils unzip git cpio vim && \
Michele Compostella's avatar
Michele Compostella committed
42
43
44
45
46
  apt-get install -y gcc gfortran libblas-dev liblapack-dev python python-pip python3 python3-pip ffmpeg imagemagick && \
  apt-get install -y libsm6 libgl1 libgl1-mesa-dri libgl1-mesa-glx libpcre3-dev libxt6 && \
  apt-get autoclean && \
  apt-get autoremove

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Installing Python3 modules
RUN pip3 install numpy matplotlib vtk
RUN pip3 install mayavi

# Adding standard user
RUN adduser --disabled-password --gecos '' --uid 1000 --gid 100 favad

# Environment variables
ENV DEBIAN_FRONTEND noninteractive
ENV HOME /home/favad
ENV PREF $HOME/software
ENV QUIP_ARCH linux_x86_64_gfortran
ENV QUIP_STRUCTS_DIR $PREF/QUIP/structs
ENV QUIP_INSTALLDIR $PREF/QUIP/bin

Michele Compostella's avatar
Michele Compostella committed
62
63
# Copying software source files
COPY ./software /tmp/software
64
RUN chown -R favad /tmp/software
Michele Compostella's avatar
Michele Compostella committed
65

66
67
68
# Copying sample files
COPY ./sample $HOME/sample
RUN  chown -R favad $HOME/sample
Michele Compostella's avatar
Michele Compostella committed
69

70
71
72
73
74
75
# Switching to standard user
USER favad
WORKDIR $HOME

# Creating installation folder
RUN mkdir -p $PREF
Michele Compostella's avatar
Michele Compostella committed
76
77
78

# Installing QUIP
RUN \
79
80
81
  tar xvzf /tmp/software/QUIP.tar.gz -C $PREF/. && \
  cd $PREF/QUIP/ && \
  tar xvzf /tmp/software/GAP.tar.gz -C $PREF/QUIP/src/. && \
Michele Compostella's avatar
Michele Compostella committed
82
83
84
85
86
87
  (echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo y ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ) | make config && \
  make && \
  make install 

# Installing VORO++
RUN \
88
89
90
91
  mkdir -p $PREF/voro++ && \
  tar xvzf /tmp/software/voro++-0.4.6.tar.gz -C $PREF/voro++ --strip-components 1 && \
  cd $PREF/voro++/ && \
  sed -i "21s|.*|PREFIX=$PREF/voro++|" ./config.mk && \
Michele Compostella's avatar
Michele Compostella committed
92
93
94
95
96
  make && \
  make install

# Installing KDTREE2
RUN \
97
98
  tar xvzf /tmp/software/kdtree2.tar.gz -C $PREF/. && \
  cd $PREF/kdtree2/ && \
Michele Compostella's avatar
Michele Compostella committed
99
100
101
102
103
  gfortran -c kdtree2.f90 && \
  gfortran -o kdtree2_iaea_v03.x kdtree2_iaea_v03.f90 kdtree2.o

# Installing VisIt
RUN \
104
  mkdir -p $PREF/visit/ && \
Michele Compostella's avatar
Michele Compostella committed
105
  cd /tmp/software/ && \
106
107
  chmod 755 ./visit-install2_13_3 && \
  (echo 1) | bash ./visit-install2_13_3 2.13.3 linux-x86_64-ubuntu18-wmesa $PREF/visit/
Michele Compostella's avatar
Michele Compostella committed
108

109
110
111
# Copying script for PCA
RUN cp /tmp/software/Principal_Component_Analysis/ $PREF/.

Michele Compostella's avatar
Michele Compostella committed
112
113
114
115
116
117
# Removing installation packages
RUN rm -rf /tmp/software/

# Run bash when the container launches
CMD ["/bin/bash"]