Skip to content

Commit

Permalink
Support multiple architectures by going back to single-stage build (#9)
Browse files Browse the repository at this point in the history
* bugfix dockerfile

* undo multistage build 😭😭😭
  • Loading branch information
zachlipp authored Sep 20, 2024
1 parent 1129478 commit 2149f8f
Showing 1 changed file with 7 additions and 26 deletions.
33 changes: 7 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ RUN apt-get update && \
libblosc-dev=1.21.3+ds-1 \
cmake=3.25.1-1 \
python3-pybind11=2.10.3-1 \
python3-dev=3.11.2-1+b1
python3-dev=3.11.2-1+b1 \
python3-venv=3.11.2-1+b1 \
python3-pip=23.0.1+dfsg-1

RUN git clone https://github.com/AcademySoftwareFoundation/openvdb.git && \
cd openvdb && \
Expand All @@ -18,30 +20,6 @@ RUN git clone https://github.com/AcademySoftwareFoundation/openvdb.git && \
make && \
make install

FROM python:3.11-slim@sha256:50ec89bdac0a845ec1751f91cb6187a3d8adb2b919d6e82d17acf48d1a9743fc

# --- cpp ---
COPY --from=builder \
# openvdb binaries
/openvdb/build/openvdb/openvdb/libopenvdb.so* \
# build dependencies from ldd
/lib/aarch64-linux-gnu/libtbb.so.12 \
/lib/aarch64-linux-gnu/libblosc.so.1 \
/lib/aarch64-linux-gnu/libz.so.1 \
/lib/aarch64-linux-gnu/libboost_iostreams.so.1.74.0 \
/lib/aarch64-linux-gnu/libm.so.6 \
/lib/aarch64-linux-gnu/liblz4.so.1 \
/lib/aarch64-linux-gnu/libsnappy.so.1 \
/lib/aarch64-linux-gnu/libzstd.so.1 \
/lib/aarch64-linux-gnu/libbz2.so.1.0 \
/lib/aarch64-linux-gnu/liblzma.so.5 \
/usr/local/lib64/libstdc++.so.6 \
/usr/local/lib64/libgcc_s.so.1 \
/lib/aarch64-linux-gnu \
# --- python ---
COPY --from=builder \
/openvdb/build/openvdb/openvdb/python/pyopenvdb.cpython-311-aarch64-linux-gnu.so /usr/local/lib/python3.11/site-packages/

RUN useradd -ms /bin/bash nonroot

WORKDIR /home/nonroot
Expand All @@ -50,8 +28,11 @@ USER nonroot

COPY neurovolume_deps.txt .

# This path doesn't exist yet; we create it in the next layer
ENV PATH="/home/nonroot/.venv/bin:$PATH"

RUN python3 -m venv .venv && \
# TODO: Parametrize?
pip install -r neurovolume_deps.txt

ENTRYPOINT [ "sleep", "infinity" ]
ENTRYPOINT [ "sleep", "infinity" ]

0 comments on commit 2149f8f

Please sign in to comment.