Dockerfile 3.02 KB
Newer Older
1 2
ARG CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX
FROM ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/ubuntu:20.04
3 4
SHELL ["/bin/bash", "-c"]

5
# Install every dependency of Sophya + downstream projects
6 7 8 9
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update                                                          \
    && apt-get -y dist-upgrade                                                 \
    && apt-get -y install --no-install-recommends                              \
10
                          autoconf build-essential ca-certificates curl        \
11 12 13 14
                          gfortran git grep libcfitsio-dev libcurl4-gnutls-dev \
                          libedit-dev libfftw3-dev libhdf5-dev liblua5.3-dev   \
                          libmotif-dev libopenblas-pthread-dev                 \
                          libwxgtk3.0-gtk3-dev wcslib-dev                      \
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
    && rm -rf /var/lib/apt/lists/*

# Honor Sophya's library naming expectations
RUN ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so                          \
          /usr/lib/x86_64-linux-gnu/libhdf5.so                                 \
    && ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.a                             \
             /usr/lib/x86_64-linux-gnu/liblua.a                                \
    && ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so                            \
             /usr/lib/x86_64-linux-gnu/liblua.so

# Do custom builds in /root as a somewhat cleaner alternative to /
WORKDIR /root

# Compile XEphem's libastro and install it the way Sophya likes it
RUN git clone --branch 4.0.2 --depth 1 https://github.com/XEphem/XEphem.git    \
    && cd XEphem/libastro                                                      \
    && make CFLAGS='-O2 -Wall -fPIC' libastro.a libastro.so                    \
    && mv libastro.a /usr/lib/x86_64-linux-gnu/libxastro.a                     \
    && mv libastro.so /usr/lib/x86_64-linux-gnu/libxastro.so                   \
    && make clobber                                                            \
    && cd ..                                                                   \
    && mv libastro /usr/include/XAstro                                         \
    && cd ..                                                                   \
    && rm -rf XEphem

# Compile libsharp from github, as ubuntu's libsharp-dev doesn't feature
# the libfftpack component Sophya uses.
42
RUN git clone --depth 1 https://github.com/HadrienG2/libsharp.git              \
43 44 45 46 47 48 49 50
    && cd libsharp                                                             \
    && autoconf                                                                \
    && ./configure --enable-pic                                                \
    && make                                                                    \
    && mv auto/lib/* /usr/lib                                                  \
    && mv auto/include /usr/include/Sharp                                      \
    && cd ..                                                                   \
    && rm -rf libsharp