From d5bbd599790e25acd26b67872c3045ff8b18f375 Mon Sep 17 00:00:00 2001 From: Johannes Schickling Date: Tue, 18 Nov 2014 14:05:19 +0100 Subject: [PATCH] opencv --- opencv/Dockerfile | 9 +++++++++ opencv/README.md | 28 ++++++++++++++++++++++++++++ opencv/install.sh | 28 ++++++++++++++++++++++++++++ rust/README.md | 25 +++---------------------- 4 files changed, 68 insertions(+), 22 deletions(-) create mode 100644 opencv/Dockerfile create mode 100644 opencv/README.md create mode 100644 opencv/install.sh diff --git a/opencv/Dockerfile b/opencv/Dockerfile new file mode 100644 index 0000000..6b414be --- /dev/null +++ b/opencv/Dockerfile @@ -0,0 +1,9 @@ +FROM debian:wheezy +MAINTAINER Johannes Schickling "schickling.j@gmail.com" + +ADD install.sh install.sh +RUN chmod +x install.sh && ./install.sh && rm install.sh + +VOLUME ["/source"] +WORKDIR /source +CMD ["bash"] diff --git a/opencv/README.md b/opencv/README.md new file mode 100644 index 0000000..f16d62c --- /dev/null +++ b/opencv/README.md @@ -0,0 +1,28 @@ +# rust + +Lightweight nightly Rust build including Cargo and GDB + +## Usage + +```sh +$ docker run --rm -it -v $(pwd):/source schickling/rust +``` + +Mount your local source folder to the container and compile & run code inside. + +#### Compiling code + +```sh +$ rustc hello-world.rs +$ ./hello-world +> Hello World! +``` + +#### Environment variables + +The `$USER` environment variable can be specified, which is used by `cargo`. The default is `root`. + +```sh +$ docker run --rm -it -e USER="John Doe" -v $(pwd):/source schickling/rust +``` + diff --git a/opencv/install.sh b/opencv/install.sh new file mode 100644 index 0000000..f2344c8 --- /dev/null +++ b/opencv/install.sh @@ -0,0 +1,28 @@ +#! /bin/bash + +opencv_version=2.4.10.1 +opencv_deps=(libopencv-dev yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg) +install_deps=(curl build-essential checkinstall cmake pkg-config) + +# install dependencies +apt-get update && apt-get install -y $install_deps + +# download opencv +curl -sL https://github.com/Itseez/opencv/archive/$opencv_version.tar.gz | tar xvz -C /tmp + +# install +cd /tmp/opencv-$opencv_version && mkdir build && cd build +cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_OPENGL=ON .. +make -j2 +make install + +# configure +echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf +ldconfig + +# cleanup package manager +apt-get remove --purge -y $install_deps && apt-get autoclean && apt-get clean +rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# prepare dir +mkdir /source diff --git a/rust/README.md b/rust/README.md index f16d62c..efdb174 100644 --- a/rust/README.md +++ b/rust/README.md @@ -1,28 +1,9 @@ -# rust +# opencv -Lightweight nightly Rust build including Cargo and GDB +Lightweight ready-to use OpenCV image ## Usage ```sh -$ docker run --rm -it -v $(pwd):/source schickling/rust +$ docker run --rm -it -v $(pwd):/source schickling/opencv ``` - -Mount your local source folder to the container and compile & run code inside. - -#### Compiling code - -```sh -$ rustc hello-world.rs -$ ./hello-world -> Hello World! -``` - -#### Environment variables - -The `$USER` environment variable can be specified, which is used by `cargo`. The default is `root`. - -```sh -$ docker run --rm -it -e USER="John Doe" -v $(pwd):/source schickling/rust -``` -