-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
126 lines (95 loc) · 3.79 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
# ===== stage 1 =====
FROM openjdk:8 as build-pathway-exchange
ENV ANT_VERSION=1.8.0 \
ANT_HOME=/opt/ant
WORKDIR /tmp
# download apache ant, extract to opt, and add exec to path
RUN wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
wget --no-check-certificate --no-cookies http://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz.md5 && \
echo "$(cat apache-ant-${ANT_VERSION}-bin.tar.gz.md5) apache-ant-${ANT_VERSION}-bin.tar.gz" | md5sum && \
tar -zvxf apache-ant-${ANT_VERSION}-bin.tar.gz -C /opt/ && \
ln -s /opt/apache-ant-${ANT_VERSION} /opt/ant && \
rm -f apache-ant-${ANT_VERSION}-bin.tar.gz && \
rm -f apache-ant-${ANT_VERSION}-bin.tar.gz.md5 && \
update-alternatives --install "/usr/bin/ant" "ant" "/opt/ant/bin/ant" 1 && \
update-alternatives --set "ant" "/opt/ant/bin/ant"
ENV URL="https://github.com/reactome/Pathway-Exchange.git" \
DIRECTORY="Pathway-Exchange" \
ANT_FILE="PathwayExchangeJar.xml" \
OUTPUT="pathwayExchange.jar" \
START_DIR=.
WORKDIR /gitroot/$DIRECTORY
# clone "Pathway-Exchange" repo, and build with ant
RUN git clone $URL . && \
ant -DdestDir="$START_DIR" -buildfile ant/$ANT_FILE
# ===== stage 2 =====
FROM maven:3.6.3-openjdk-8 as build-download-directory
ENV GROUP_ID="org.reactome.pathway-exchange" \
ARTIFACT_ID="pathwayExchange" \
DIRECTORY="Pathway-Exchange" \
OUTPUT="pathwayExchange.jar" \
VERSION=1.0.1
WORKDIR /gitroot/reactome-release-directory
# copy "release-download-directory" from local
COPY . .
# copy jar build artifact from stage 1
COPY --from=build-pathway-exchange /gitroot/$DIRECTORY/$OUTPUT /tmp/$OUTPUT
# install jar build artifact from stage 1, build "release-download-directory", and uncompress artifacts
RUN mvn install:install-file -Dfile="/tmp/$OUTPUT" -DgroupId=$GROUP_ID -DartifactId=$ARTIFACT_ID -Dversion=$VERSION -Dpackaging=jar && \
mvn clean package -DskipTests
# ===== stage 3 =====
FROM eclipse-temurin:8-jre-focal
WORKDIR /opt/release-download-directory
COPY --from=build-download-directory /gitroot/reactome-release-directory/target/download-directory.jar target/
COPY --from=build-download-directory /gitroot/reactome-release-directory/src/main/resources/ src/main/resources/
# install dependencies for protege perl program
RUN apt update && apt install -y \
apt-utils \
tree \
make \
build-essential \
git \
cpanminus \
libssl-dev \
zlib1g-dev \
libz-dev
RUN cpanm CGI
RUN wget https://cpan.metacpan.org/authors/id/C/CJ/CJFIELDS/BioPerl-1.7.8.tar.gz && \
tar -xzvf BioPerl-1.7.8.tar.gz && \
mv BioPerl-1.7.8/lib/Bio . && \
rm BioPerl-1.7.8 -r && \
rm BioPerl-1.7.8.tar.gz
RUN cpanm Log::Log4perl
RUN apt install -y libdbi-perl
RUN wget https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz && \
tar zxvf libgd-2.2.5.tar.gz && \
cd libgd-2.2.5 && \
./configure && \
make && \
make install && \
make installcheck
RUN apt install -y \
libxml-simple-perl \
pkg-config \
libgd3 \
libgd-perl
RUN cpanm GD::Polygon --force && \
cpanm WWW::SearchResult
RUN apt install -y \
mariadb-client \
libdbd-mysql-perl
ENV PERL5LIB=/opt/release-download-directory/Release/modules/
RUN git clone https://github.com/reactome/Release.git
COPY secrets.pm /opt/release-download-directory/Release/modules/GKB/
# PadWalker needed for test-memory-cycle
RUN cpanm Net::SSLeay && \
cpanm IO::Socket::SSL && \
cpanm XML::LibXML::Reader && \
cpanm XML::Twig && \
cpanm XML::DOM && \
cpanm PadWalker && \
cpanm Test::Memory::Cycle && \
cpanm Bio::Root::Root && \
cpanm XML::Parser::PerlSAX && \
cpanm Graph::Directed XML::LibXML && \
cpanm Set::Object