2021-09-02 22:12:18 +00:00
|
|
|
FROM ubuntu:21.04 AS builder
|
2019-04-09 18:38:19 +00:00
|
|
|
|
|
|
|
# Env variables
|
2020-11-02 18:35:32 +00:00
|
|
|
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" \
|
2020-11-02 18:35:32 +00:00
|
|
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib"
|
2019-04-09 18:38: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-16 14:04:51 +00:00
|
|
|
RUN PORTABLE_INSTALL=YES bash configure.sh install
|
2019-04-09 18:38:19 +00:00
|
|
|
|
|
|
|
# Clean Superbuild
|
2021-01-24 14:45:00 +00:00
|
|
|
RUN bash configure.sh clean
|
2020-11-02 18:35:32 +00:00
|
|
|
|
|
|
|
### END Builder
|
|
|
|
|
|
|
|
### Use a second image for the final asset to reduce the number and
|
|
|
|
# size of the layers.
|
2021-09-02 22:12:18 +00:00
|
|
|
FROM ubuntu:21.04
|
2020-11-02 18:35:32 +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" \
|
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 \
|
2022-01-12 19:18:49 +00:00
|
|
|
&& 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'"
|
2020-11-02 18:35:32 +00:00
|
|
|
|
2019-04-09 18:38:19 +00:00
|
|
|
# Entry point
|
2020-09-16 14:04:51 +00:00
|
|
|
ENTRYPOINT ["python3", "/code/run.py"]
|