-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (48 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
58 lines (48 loc) · 1.29 KB
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
# Builder stage
FROM nvidia/cuda:12.3.1-devel-ubuntu22.04 AS builder
# Install build dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
git \
cmake \
libomp-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Clone and build niimath
WORKDIR /build
RUN git clone https://github.com/rordenlab/niimath.git && \
cd niimath && \
cd src && \
make
# Main image
FROM nvidia/cuda:12.3.1-devel-ubuntu22.04
# Install runtime dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3 \
python3-pip \
libomp5 \
zlib1g \
pigz \
clang \
llvm \
gcc-aarch64-linux-gnu \
&& rm -rf /var/lib/apt/lists/*
# Create directories
RUN mkdir -p /opt/niimath/linux
# Copy the binary - CMake typically builds it without extension
COPY --from=builder /build/niimath/src/niimath /opt/niimath/linux/niimath
# Rest of your Dockerfile
WORKDIR /app
COPY . .
ENV NIIMATH_PATH=/opt/niimath
ENV NIIMATH_TEMP=/tmp
ENV AFNI_COMPRESSOR=PIGZ
# Set compiler flags for ARM compatibility
ENV CFLAGS="-O2 -fPIC -ffreestanding -fno-math-errno"
ENV LDFLAGS="-fuse-ld=lld"
# Install Python dependencies
RUN pip install --no-cache-dir .
# Set the entrypoint
ENTRYPOINT ["brainchop"]