2021-02-09 17:14:05 +00:00
|
|
|
FROM nvidia/cuda:11.2.0-runtime-ubuntu20.04 AS builder
|
|
|
|
|
|
|
|
# Env variables
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
|
|
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/src/opensfm" \
|
|
|
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib"
|
|
|
|
|
|
|
|
# Prepare directories
|
|
|
|
WORKDIR /code
|
|
|
|
|
|
|
|
# Copy everything
|
|
|
|
COPY . ./
|
|
|
|
|
|
|
|
# Run the build
|
2021-03-05 15:44:08 +00:00
|
|
|
RUN PORTABLE_INSTALL=YES GPU_INSTALL=YES bash configure.sh install
|
2021-02-09 17:14:05 +00:00
|
|
|
|
|
|
|
# Clean Superbuild
|
|
|
|
RUN bash configure.sh clean
|
|
|
|
|
|
|
|
### END Builder
|
|
|
|
|
|
|
|
### Use a second image for the final asset to reduce the number and
|
|
|
|
# size of the layers.
|
|
|
|
FROM nvidia/cuda:11.2.0-runtime-ubuntu20.04
|
|
|
|
|
|
|
|
# Env variables
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
|
|
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/src/opensfm" \
|
|
|
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib"
|
|
|
|
|
|
|
|
WORKDIR /code
|
|
|
|
|
|
|
|
# Copy everything we built from the builder
|
|
|
|
COPY --from=builder /code /code
|
|
|
|
|
|
|
|
# Copy the Python libraries installed via pip from the builder
|
|
|
|
COPY --from=builder /usr/local /usr/local
|
|
|
|
|
2021-02-10 19:00:43 +00:00
|
|
|
# Install OpenCL Drivers
|
2021-03-15 16:00:21 +00:00
|
|
|
RUN apt update && apt install -y nvidia-opencl-icd-340 intel-opencl-icd
|
2021-02-10 19:00:43 +00:00
|
|
|
|
2021-02-09 17:14:05 +00:00
|
|
|
# Install shared libraries that we depend on via APT, but *not*
|
|
|
|
# the -dev packages to save space!
|
|
|
|
RUN bash configure.sh installruntimedepsonly \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
# Entry point
|
|
|
|
ENTRYPOINT ["python3", "/code/run.py"]
|