This repository has been archived by the owner on Apr 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-ubuntu
97 lines (85 loc) · 4.65 KB
/
Dockerfile-ubuntu
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
FROM ubuntu:latest
# Dockerfile to build ASIAA carta-backend on Ubuntu 19-11-18
# Install required packages
RUN \
apt-get update && \
apt-get -y upgrade && \
apt-get install -y flex bison libbison-dev sqlite sqlite3 libsqlite3-dev libleveldb-dev \
gcc gfortran libblas-dev libblas3 wget cmake git \
python-numpy libfftw3-dev liblapacke-dev libboost-dev liblapack-dev liblapack3 liblapacke \
libxerces-c-dev libncurses5-dev libboost-python-dev libboost-regex-dev libboost-program-options-dev \
libboost-thread-dev libboost-serialization-dev libboost-filesystem-dev libboost-system-dev \
libcfitsio-dev wcslib-dev curl unzip doxygen libeigen3-dev libgl1-mesa-dev rapidjson-dev \
subversion libx11-dev libgsl-dev libxml2-dev libxslt1-dev libxerces-c-dev sed libreadline-dev \
libdbus-1-3 libx11-xcb-dev libssl1.0-dev cmake autoconf libtool
# casacode needs libsakura
RUN \
mkdir -p /cartawork/CARTAvis-externals/ThirdParty && \
cd /cartawork/CARTAvis-externals/ThirdParty && \
git clone https://github.com/CARTAvis/libsakura && \
curl -o gtest-1.7.0.zip -L https://github.com/google/googletest/archive/release-1.7.0.zip && \
unzip gtest-1.7.0.zip -d libsakura > /dev/null && \
cd libsakura && ln -s googletest-release-1.7.0 gtest && mkdir build && cd build && \
cmake .. && make && make apidoc && make install
# Install casacore and code
RUN \
mkdir -p /cartawork/CARTAvis-externals/ThirdParty/casa && \
cd /cartawork/CARTAvis-externals/ThirdParty/casa && \
git clone --recursive https://github.com/CARTAvis/New-casa.git trunk && \
cd trunk/casacore && mkdir build && cd build && \
cmake -DBoost_NO_BOOST_CMAKE=1 -DCASA_BUILD=1 -DBUILD_TESTING=OFF -DUseCasacoreNamespace=1 \
-DCMAKE_INSTALL_PREFIX=../../linux -DBUILD_PYTHON=1 -DCMAKE_BUILD_TYPE=Release -DCXX11=1 .. && \
make -j 2 && make install && \
cd ../../code && mkdir build && cd build && \
sed -i 's/VERSION_EQUAL 3.2/VERSION_EQUAL 3.5/g' /cartawork/CARTAvis-externals/ThirdParty/casa/trunk/code/CMakeLists.txt && \
sed -i 's/VERSION_GREATER 3.2/VERSION_GREATER 3.5/g' /cartawork/CARTAvis-externals/ThirdParty/casa/trunk/code/CMakeLists.txt && \
cmake -DUseCrashReporter=0 -DBoost_NO_BOOST_CMAKE=1 -DEXTRA_C_FLAGS=-DPG_PPU \
-DUseCasacoreNamespace=1 \
-DLIBSAKURA_ROOT_DIR=/opt/casa/01/lib/libsakura/default/ \
-Darch=linux -DCMAKE_BUILD_TYPE=Release .. && make -j 2 && \
mkdir -p /cartawork/CARTAvis-externals/ThirdParty/casacore && \
mkdir -p /cartawork/CARTAvis-externals/ThirdParty/imageanalysis && \
cd /cartawork/CARTAvis-externals/ThirdParty/imageanalysis && \
ln -s /cartawork/CARTAvis-externals/ThirdParty/casa/trunk/linux/include/casacode/ include && \
ln -s /cartawork/CARTAvis-externals/ThirdParty/casa/trunk/linux/lib lib && \
cd ../casacore && \
ln -s /cartawork/CARTAvis-externals/ThirdParty/casa/trunk/linux/include/ include && \
ln -s /cartawork/CARTAvis-externals/ThirdParty/casa/trunk/linux/lib lib
# Install Qt (courtesy of instructions from here: https://flames-of-code.netlify.com/blog/qt-on-docker)
# Remember to place the 'qt-noninteractive.qs' file in the same directory as the Dockerfile
ENV QT_VERSION_A=5.9
ENV QT_VERSION_B=5.9.4
ENV QT_VERSION_SCRIPT=594
COPY qt-noninteractive.qs /qt-noninteractive.qs
RUN \
wget https://download.qt.io/archive/qt/${QT_VERSION_A}/${QT_VERSION_B}/qt-opensource-linux-x64-${QT_VERSION_B}.run && \
chmod +x qt-opensource-linux-x64-${QT_VERSION_B}.run && \
./qt-opensource-linux-x64-${QT_VERSION_B}.run --script qt-noninteractive.qs -platform minimal && \
rm qt-opensource-linux-x64-${QT_VERSION_B}.run && rm qt-noninteractive.qs
# Install uWebSockets
RUN \
cd /root && \
git clone https://github.com/uNetworking/uWebSockets.git && \
cd uWebSockets && git checkout v0.14 && cd .. && \
make default install -C uWebSockets && \
rm -rf uWebSockets
# Install zfp
RUN \
cd /root && \
git clone https://github.com/LLNL/zfp.git && \
mkdir -p zfp/build && cd zfp/build && \
cmake .. && make all install && \
cd /root && rm -rf zfp
# Install protobuffer
RUN \
cd /root && git clone https://github.com/protocolbuffers/protobuf.git && cd protobuf && \
./autogen.sh && ./configure --prefix=/cartawork/CARTAvis-externals/ThirdParty/protobuf && \
make && make install
# Download the measures data directory
RUN \
cd /root && wget http://alma.asiaa.sinica.edu.tw/_downloads/measures_data.tar.gz && \
tar -xvf measures_data.tar.gz && mv measures_data data && rm measures_data.tar.gz
EXPOSE 3002
ENV PATH=/qt/5.9.4/gcc_64/bin:$PATH
ENV LD_LIBRARY_PATH=/cartawork/CARTAvis-externals/ThirdParty/casacore/lib:/cartawork/CARTAvis-externals/ThirdParty/protobuf/lib:/usr/local/lib:$LD_LIBRARY_PATH
WORKDIR /cartawork