OpenDroneMap-ODM/gpu.Dockerfile

53 wiersze
1.9 KiB
Plaintext
Czysty Zwykły widok Historia

2023-07-15 06:03:57 +00:00
FROM nvidia/cuda:11.2.2-devel-ubuntu20.04 AS builder
2021-02-09 17:14:05 +00:00
# Env variables
ENV DEBIAN_FRONTEND=noninteractive \
2022-02-17 17:32:24 +00:00
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.9/dist-packages:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/install/bin/opensfm" \
2021-02-09 17:14:05 +00:00
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib"
# Prepare directories
WORKDIR /code
# Copy everything
COPY . ./
# Run the build
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.
2024-07-05 07:46:57 +00:00
FROM nvidia/cuda:11.2.2-runtime-ubuntu20.04
2024-07-04 13:39:11 +00:00
#FROM nvidia/cuda:11.2.0-devel-ubuntu20.04
2021-02-09 17:14:05 +00:00
# Env variables
ENV DEBIAN_FRONTEND=noninteractive \
2022-02-17 17:32:24 +00:00
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.9/dist-packages:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/install/bin/opensfm" \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib" \
PDAL_DRIVER_PATH="/code/SuperBuild/install/bin"
2021-02-09 17:14:05 +00:00
2024-07-05 07:46:57 +00:00
WORKDIR /code
2021-02-09 17:14:05 +00:00
# Copy everything we built from the builder
2024-07-05 07:46:57 +00:00
COPY --from=builder /code /code
2021-02-09 17:14:05 +00:00
# Copy the Python libraries installed via pip from the builder
2024-07-05 07:46:57 +00:00
COPY --from=builder /usr/local /usr/local
#COPY --from=builder /usr/lib/x86_64-linux-gnu/libavcodec.so.58 /usr/lib/x86_64-linux-gnu/libavcodec.so.58
RUN apt-get update -y \
&& apt-get install -y ffmpeg libtbb2
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!
2022-01-12 17:17:31 +00:00
# Also run a smoke test on ODM and OpenSfM
2024-07-05 07:46:57 +00:00
RUN bash configure.sh installruntimedepsonly \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& bash run.sh --help \
&& bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'"
2021-02-09 17:14:05 +00:00
# Entry point
ENTRYPOINT ["python3", "/code/run.py"]