diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..331d387 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +Dockerfile diff --git a/Dockerfile b/Dockerfile index 1347f48..df762bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,34 @@ -FROM gnuhub/base-docker -MAINTAINER Stallman Wang "gnuhub@gmail.com" +from ubuntu:14.04 -ADD /docker/etc/apt/sources.list /etc/apt/sources.list -ADD /docker/etc/apt/trusted.gpg /etc/apt/trusted.gpg -RUN sudo apt-get update -RUN apt-get install -y --force-yes build-essential -RUN apt-get install -y m4 -RUN apt-get install -y flex -RUN apt-get install -y bison -RUN apt-get install -y gawk -RUN apt-get install -y texinfo -RUN apt-get install -y autoconf -RUN apt-get install -y libtool -RUN apt-get install -y pkg-config +# Install prerequisites +run apt-get update && apt-get install -y \ + build-essential \ + cmake \ + curl \ + git \ + libcurl3-dev \ + libleptonica-dev \ + liblog4cplus-dev \ + libopencv-dev \ + libtesseract-dev \ + wget -RUN apt-get install -y openssl -RUN apt-get install -y curl -RUN apt-get install -y libreadline6 -RUN apt-get install -y git -RUN apt-get install -y zlib1g -RUN apt-get install -y autoconf -RUN apt-get install -y automake -RUN apt-get install -y libtool -RUN apt-get install -y imagemagick -RUN apt-get install -y make -RUN apt-get install -y tree -RUN apt-get install -y gdb -RUN apt-get install -y libopencv-dev libtesseract-dev git cmake build-essential libleptonica-dev -RUN apt-get install -y liblog4cplus-dev libcurl3-dev -RUN apt-get install -y beanstalkd -RUN apt-get install -y wget +# Copy all data +copy . /srv/openalpr + +# Setup the build directory +run mkdir /srv/openalpr/src/build +workdir /srv/openalpr/src/build + +# Setup the compile environment +run cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc .. + +# Compile the library +run make + +# Install the binaries/libraries to your local system (prefix is /usr) +run make install + +workdir /data + +entrypoint ["alpr"] diff --git a/README.md b/README.md index 5b4e06f..fa0f411 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,17 @@ Please follow these detailed compilation guides for your respective operating sy If all went well, there should be an executable named *alpr* along with *libopenalpr-static.a* and *libopenalpr.so* that can be linked into your project. +Docker +------ + +``` shell +# Build docker image +docker build -t openalpr https://github.com/openalpr/openalpr.git +# Download test image +wget http://plates.openalpr.com/h786poj.jpg +# Run alpr on image +docker run -it --rm -v $(pwd):/data:ro openalpr -c eu h786poj.jpg +``` Questions --------- diff --git a/docker/etc/apt/sources.list b/docker/etc/apt/sources.list deleted file mode 100644 index 9b7d8dc..0000000 --- a/docker/etc/apt/sources.list +++ /dev/null @@ -1,35 +0,0 @@ -# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to -# newer versions of the distribution. - -deb http://archive.ubuntu.com/ubuntu/ trusty main restricted -deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted -deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted - -## Uncomment the following two lines to add software from the 'universe' -## repository. -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://archive.ubuntu.com/ubuntu/ trusty universe -deb-src http://archive.ubuntu.com/ubuntu/ trusty universe -deb http://archive.ubuntu.com/ubuntu/ trusty-updates universe -deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates universe - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -# deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted -# deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted - -deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted -deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted -deb http://archive.ubuntu.com/ubuntu/ trusty-security universe -deb-src http://archive.ubuntu.com/ubuntu/ trusty-security universe -# deb http://archive.ubuntu.com/ubuntu/ trusty-security multiverse -# deb-src http://archive.ubuntu.com/ubuntu/ trusty-security multiverse diff --git a/docker/etc/apt/trusted.gpg b/docker/etc/apt/trusted.gpg deleted file mode 100644 index b18548d..0000000 Binary files a/docker/etc/apt/trusted.gpg and /dev/null differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd2c7de..2202ffa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -115,16 +115,6 @@ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/config/openalpr.conf DESTINATION IF (WITH_DAEMON) install (TARGETS alprd DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install (FILES ${CMAKE_SOURCE_DIR}/../config/alprd.conf DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/openalpr COMPONENT config) - - install (FILES ${CMAKE_SOURCE_DIR}/../upstart/alprd.conf DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init COMPONENT config) - - # Ideally, these two files should be owned by the "daemon" user, but cmake does not seem to allow that - # Making them world writable as a hack - install (FILES ${CMAKE_SOURCE_DIR}/../upstart/alprd.log DESTINATION ${CMAKE_INSTALL_VARDIR}/log - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE ) - install (FILES ${CMAKE_SOURCE_DIR}/../upstart/alprd.pid DESTINATION ${CMAKE_INSTALL_VARDIR}/run - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_READ WORLD_WRITE ) - ENDIF()