2020-11-05 22:47:49 +00:00
|
|
|
FROM ubuntu:20.04 AS builder
|
2017-04-10 17:02:19 +00:00
|
|
|
|
|
|
|
# Env variables
|
2020-11-02 18:35:32 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
2020-11-05 22:47:49 +00:00
|
|
|
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/src/opensfm" \
|
2020-11-02 18:35:32 +00:00
|
|
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib"
|
2017-04-10 17:02:19 +00:00
|
|
|
|
|
|
|
# Prepare directories
|
|
|
|
WORKDIR /code
|
|
|
|
|
2020-02-29 00:54:26 +00:00
|
|
|
# Copy everything
|
|
|
|
COPY . ./
|
2019-09-16 22:36:51 +00:00
|
|
|
|
2020-11-02 18:35:32 +00:00
|
|
|
# Run the build
|
2020-09-08 17:08:57 +00:00
|
|
|
RUN bash configure.sh install
|
2019-03-26 23:21:44 +00:00
|
|
|
|
2017-04-10 17:02:19 +00:00
|
|
|
# Clean Superbuild
|
2019-03-26 23:21:44 +00:00
|
|
|
RUN rm -rf \
|
|
|
|
/code/SuperBuild/build/opencv \
|
|
|
|
/code/SuperBuild/download \
|
|
|
|
/code/SuperBuild/src/ceres \
|
2020-11-05 22:47:49 +00:00
|
|
|
/code/SuperBuild/src/entwine \
|
|
|
|
/code/SuperBuild/src/gflags \
|
|
|
|
/code/SuperBuild/src/hexer \
|
|
|
|
/code/SuperBuild/src/lastools \
|
|
|
|
/code/SuperBuild/src/laszip \
|
2019-03-26 23:21:44 +00:00
|
|
|
/code/SuperBuild/src/mvstexturing \
|
|
|
|
/code/SuperBuild/src/opencv \
|
|
|
|
/code/SuperBuild/src/opengv \
|
|
|
|
/code/SuperBuild/src/pcl \
|
2020-10-27 21:10:10 +00:00
|
|
|
/code/SuperBuild/src/pdal \
|
|
|
|
/code/SuperBuild/src/openmvs \
|
2020-10-27 23:30:11 +00:00
|
|
|
/code/SuperBuild/build/openmvs \
|
2020-11-05 22:47:49 +00:00
|
|
|
/code/SuperBuild/src/vcg \
|
|
|
|
/code/SuperBuild/src/zstd
|
2017-04-10 17:02:19 +00:00
|
|
|
|
2020-11-02 18:35:32 +00:00
|
|
|
# find in /code and delete...
|
|
|
|
RUN find /code \
|
|
|
|
# ...*static* libraries...
|
|
|
|
-type f -name "*.a" -delete \
|
|
|
|
# ...and intermediate object files
|
|
|
|
-or -type f -name "*.o" -delete
|
|
|
|
|
|
|
|
### END Builder
|
|
|
|
|
|
|
|
### Use a second image for the final asset to reduce the number and
|
|
|
|
# size of the layers.
|
2020-11-05 22:47:49 +00:00
|
|
|
FROM ubuntu:20.04
|
2020-11-02 18:35:32 +00:00
|
|
|
|
|
|
|
# Env variables
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
2020-11-05 22:47:49 +00:00
|
|
|
PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python3.8/dist-packages:/code/SuperBuild/src/opensfm" \
|
2020-11-02 18:35:32 +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!
|
|
|
|
RUN bash configure.sh installruntimedepsonly \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
2017-04-10 17:02:19 +00:00
|
|
|
# Entry point
|
2020-11-02 18:35:32 +00:00
|
|
|
ENTRYPOINT ["python3", "/code/run.py"]
|