OpenDroneMap-ODM/gpu.Dockerfile

50 wiersze
1.5 KiB
Plaintext
Czysty Zwykły widok Historia

2021-10-22 17:03:48 +00:00
FROM nvidia/cuda:11.2.0-devel-ubuntu20.04 AS builder
2021-02-09 17:14:05 +00:00
# Env variables
ENV DEBIAN_FRONTEND=noninteractive \
2021-09-02 22:12:18 +00:00
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.9/dist-packages:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/src/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.
2021-11-15 18:05:51 +00:00
FROM nvidia/cuda:11.2.0-runtime-ubuntu20.04
#FROM nvidia/cuda:11.2.0-devel-ubuntu20.04
2021-02-09 17:14:05 +00:00
# Env variables
ENV DEBIAN_FRONTEND=noninteractive \
2021-09-02 22:12:18 +00:00
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.9/dist-packages:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/src/opensfm" \
2021-02-09 17:14:05 +00:00
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
# Install shared libraries that we depend on via APT, but *not*
# the -dev packages to save space!
2021-11-17 18:08:57 +00:00
# Also run a smoke test
2021-02-09 17:14:05 +00:00
RUN bash configure.sh installruntimedepsonly \
&& apt-get clean \
2021-11-17 18:08:57 +00:00
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& bash run.sh --help
2021-02-09 17:14:05 +00:00
# Entry point
ENTRYPOINT ["python3", "/code/run.py"]