-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
128 lines (112 loc) · 4.42 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
FROM centos:7 AS base
# ================ Builder stage =============================================
# we base our image on a vanilla Centos 7 image.
ENV ACS_PREFIX=/alma ACS_VERSION="2020.8"
ENV ACS_ROOT=$ACS_PREFIX/acs
ENV JAVA_HOME="/usr/java/default"
# install deltarpm prior to installing everything else
# it might save some time during downloading and installing the
# dependencies below, but it is not urgently needed for ACS to work
# c.f. https://www.cyberciti.biz/faq/delta-rpms-disabled-because-applydeltarpm-not-installed/
RUN yum update -y && yum install -y deltarpm && \
# The package list below is alphabetically sorted, so not sorted by importance.
# It may very well be, that noe all packages are actually needed.
# If you studied this, and found out we can shorten this list without loosing
# the ability to execute all the ACS examples, we'd be happy to hear from you
# either by opening an issue, or by you immediately fixing this and opening a
# pull request.
yum -y install epel-release && \
yum -y groupinstall "Development Tools" && \
yum -y install autoconf \
bison \
bzip2 \
bzip2-devel \
dos2unix \
epel-release \
expat-devel \
file \
flex \
freetype-devel \
gcc \
gcc-c++ \
gcc-gfortran \
git \
java-11-openjdk \
java-11-openjdk-devel \
lbzip2 \
lbzip2-utils \
libffi \
libffi-devel \
libX11-devel \
libxml2-devel \
libxslt-devel \
lockfile-progs \
make \
net-tools \
openldap-devel \
openssh-server \
openssl-devel \
perl \
procmail \
python-devel \
python2-pip \
python3-pip \
readline-devel \
redhat-lsb-core \
rpm-build \
sqlite-devel \
tcl-devel \
tk-devel \
xauth && \
yum clean all && \
# Prepare Java
mkdir -pv /usr/java && \
ln -sv /usr/lib/jvm/java-openjdk $JAVA_HOME
# ============= Compiler Stage ===============================================
FROM base AS dependency_builder
COPY acs/ /acs
RUN yum -y install \
curl \
git-lfs \
ksh \
mc \
nc \
patch \
screen \
subversion \
unzip \
vim \
wget \
tree \
xterm && \
cd /acs/ExtProd/PRODUCTS && \
## Get missing (super old) libraries
wget https://sourceforge.net/projects/gnuplot-py/files/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz/download -O gnuplot-py-1.8.tar.gz && \
wget https://sourceforge.net/projects/pychecker/files/pychecker/0.8.17/pychecker-0.8.17.tar.gz/download -O pychecker-0.8.17.tar.gz && \
wget https://sourceforge.net/projects/numpy/files/OldFiles/1.3.3/numarray-1.3.3.tar.gz && \
# some versions for python dependencies have changed.
# Also we removed the *bulkDataNT* and *bulkData* modules from the Makefile
# as we don't have the properietary version of DDS and don't use this modules.
sed -i 's/bulkDataNT bulkData //g' /acs/Makefile && \
cd /acs/ExtProd/INSTALL && \
source /acs/LGPL/acsBUILD/config/.acs/.bash_profile.acs && \
time make all && \
find /alma -name "*.o" -exec rm -v {} \;
# --------------------- Here external dependencies are built --------------
FROM dependency_builder as acs_builder
RUN cd /acs/ && \
source /acs/LGPL/acsBUILD/config/.acs/.bash_profile.acs && \
time make build
# ============= Target image stage ===========================================
FROM base
WORKDIR /
# Here we create the user almamgr
RUN groupadd -g 1000 almamgr && \
useradd -g 1000 -u 1000 -d /home/almamgr -m -s /bin/bash almamgr && \
passwd -d almamgr && \
# For conveniece we source the alma .bash_profile.acs in the user .bash_rc
# and export JAVA_HOME
echo "source /alma/ACS-2020AUG/ACSSW/config/.acs/.bash_profile.acs" >> /home/almamgr/.bashrc && \
echo "export JAVA_HOME=$JAVA_HOME" >> /home/almamgr/.bashrc
COPY --from=acs_builder --chown=almamgr /alma /alma
USER almamgr