Dockerfile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. FROM ubuntu:mantic
  2. RUN apt-get -qq update \
  3. && apt-get install -y --no-install-recommends \
  4. bash \
  5. curl \
  6. git \
  7. ca-certificates \
  8. build-essential \
  9. gobject-introspection \
  10. libgirepository1.0-dev \
  11. python3-pip \
  12. python3-venv \
  13. libssl-dev \
  14. libglib2.0-dev \
  15. libxml2-dev \
  16. libjpeg-dev \
  17. libpng-dev \
  18. libwebp-dev \
  19. librsvg2-dev \
  20. libexif-dev \
  21. liblcms2-dev \
  22. libavcodec-dev \
  23. libavformat-dev \
  24. libavutil-dev \
  25. libswscale-dev \
  26. libopencv-core-dev \
  27. libopencv-imgproc-dev \
  28. libopencv-objdetect-dev \
  29. libopencv-dnn-dev \
  30. && python3 -m venv /root/.python \
  31. && /root/.python/bin/pip install meson ninja \
  32. && rm -rf /var/lib/apt/lists/*
  33. RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \
  34. && export PATH="/root/.cargo/bin:$PATH" \
  35. && cargo install cargo-c \
  36. && cd /root \
  37. && git clone --depth 1 https://github.com/DarthSim/quantizr.git \
  38. && cd quantizr \
  39. && cargo cinstall --release --library-type=cdylib \
  40. && rm -rf /root/.rustup /root/.cargo
  41. ENV PATH="/root/.python/bin:$PATH"
  42. ENV LD_LIBRARY_PATH="/usr/local/lib"
  43. RUN \
  44. mkdir /root/vips \
  45. && cd /root/vips \
  46. && curl -s -S -L -o vips_releases.json "https://api.github.com/repos/libvips/libvips/releases" \
  47. && for VIPS_VERSION in "8.13" "8.14" "8.15"; do \
  48. mkdir $VIPS_VERSION \
  49. && export VIPS_RELEASE=$(grep -m 1 "\"tag_name\": \"v$VIPS_VERSION." vips_releases.json | sed -E 's/.*"v([^"]+)".*/\1/') \
  50. && echo "Building Vips $VIPS_RELEASE as $VIPS_VERSION" \
  51. && curl -s -S -L -o libvips-$VIPS_RELEASE.tar.gz https://github.com/libvips/libvips/archive/refs/tags/v$VIPS_RELEASE.tar.gz \
  52. && tar -xzf libvips-$VIPS_RELEASE.tar.gz \
  53. && cd libvips-$VIPS_RELEASE \
  54. && meson setup _build \
  55. --buildtype=release \
  56. --strip \
  57. --prefix=/root/vips/$VIPS_VERSION \
  58. --libdir=lib \
  59. -Dgtk_doc=false \
  60. && ninja -C _build \
  61. && ninja -C _build install \
  62. && cd .. \
  63. && rm -rf libvips-$VIPS_RELEASE.tar.gz libvips-$VIPS_RELEASE; \
  64. done
  65. RUN echo "Name: OpenCV\n" \
  66. "Description: Open Source Computer Vision Library\n" \
  67. "Version: 4.5.1\n" \
  68. "Libs: -L/usr/lib/x86_64-linux-gnu -lopencv_dnn -lopencv_objdetect -lopencv_imgproc -lopencv_core\n" \
  69. "Libs.private: -ldl -lm -lpthread -lrt\n" \
  70. "Cflags: -I/usr/include/opencv4\n" \
  71. > /usr/lib/x86_64-linux-gnu/pkgconfig/opencv4.pc
  72. WORKDIR /go/src
  73. ENTRYPOINT [ "/bin/bash" ]