-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
79 lines (74 loc) · 2.15 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
# syntax=docker/dockerfile:1
# cross-platform, cpu-only dockerfile for demoing MWA software stack
# on amd64, arm64
# ref: https://docs.docker.com/build/building/multi-platform/
# ARG BASE_IMG="ubuntu:20.04"
# HACK: newer python breaks on old ubuntu
ARG BASE_IMG="python:3.11-bookworm"
FROM ${BASE_IMG} as base
# Suppress perl locale errors
ENV LC_ALL=C
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
clang \
cmake \
curl \
cython3 \
fontconfig \
g++ \
git \
ipython3 \
jq \
lcov \
libcfitsio-dev \
liberfa-dev \
libhdf5-dev \
libpng-dev \
libpython3-dev \
pkg-config \
procps \
python3 \
python3-dev \
python3-pip \
python3-wheel \
python3-importlib-metadata \
tzdata \
unzip \
wget \
zip \
&& \
apt-get clean all && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
apt-get -y autoremove
# Get Rust
ARG RUST_VERSION=stable
ENV RUSTUP_HOME=/opt/rust CARGO_HOME=/opt/cargo PATH="/opt/cargo/bin:${PATH}"
RUN mkdir -m755 $RUSTUP_HOME $CARGO_HOME && ( \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | env RUSTUP_HOME=$RUSTUP_HOME CARGO_HOME=$CARGO_HOME sh -s -- -y \
--profile=minimal \
--default-toolchain=${RUST_VERSION} \
)
# install python prerequisites
# - newer pip needed for mwalib maturin install
# - other versions pinned to avoid issues with numpy==2
ARG SSINS_BRANCH=master
ARG MWAQA_BRANCH=dev
RUN python -m pip install --no-cache-dir \
importlib_metadata==8.2.0 \
maturin[patchelf]==1.7.0 \
pip==24.2 \
;
ARG MWALIB_BRANCH=v1.5.0
RUN git clone --depth 1 --branch=${MWALIB_BRANCH} https://github.com/MWATelescope/mwalib.git /mwalib && \
cd /mwalib && \
maturin build --release --features=python && \
python -m pip install $(ls -1 target/wheels/*.whl | tail -n 1) && \
cd / && \
rm -rf /mwalib ${CARGO_HOME}/registry
ADD . /app
WORKDIR /app
RUN maturin build --release --features=python && \
python -m pip install $(ls -1 target/wheels/*.whl | tail -n 1) && \
rm -rf ${CARGO_HOME}/registry