Created
February 22, 2016 16:40
-
-
Save joshuacalloway/d7894edef093cb269c99 to your computer and use it in GitHub Desktop.
Docker file with opencv and alpine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
#2 Add Edge and bleeding repos | |
RUN echo -e '@edge http://nl.alpinelinux.org/alpine/edge/main\n@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories | |
#3 | |
RUN apk update && apk upgrade && apk add --update \ | |
python \ | |
python-dev \ | |
make \ | |
cmake \ | |
gcc \ | |
g++ \ | |
git \ | |
pkgconf \ | |
unzip \ | |
wget \ | |
py-pip \ | |
build-base \ | |
gsl \ | |
libavc1394-dev \ | |
libtbb@testing \ | |
libtbb-dev@testing \ | |
libjpeg \ | |
libjpeg-turbo-dev \ | |
libpng-dev \ | |
libjasper \ | |
libdc1394-dev \ | |
clang \ | |
tiff-dev \ | |
libwebp-dev \ | |
py-numpy-dev@testing \ | |
py-scipy-dev@testing \ | |
linux-headers | |
#RUN apk add --update libtbb2 | |
#4 defining compilers | |
ENV CC /usr/bin/clang | |
ENV CXX /usr/bin/clang++ | |
#5 opencv2 | |
RUN mkdir /opt | |
WORKDIR /opt | |
COPY opencv-2.4.9.zip /opt | |
RUN unzip opencv-2.4.9.zip && \ | |
cd /opt/opencv-2.4.9 && \ | |
mkdir build | |
WORKDIR /opt/opencv-2.4.9/build | |
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_FFMPEG=NO \ | |
-D WITH_IPP=NO -D WITH_OPENEXR=NO .. | |
RUN make VERBOSE=1 | |
RUN make | |
RUN make install | |
#6 Clean APK cache | |
RUN rm -rf /var/cache/apk/* | |
# Java Version and other ENV | |
ENV JAVA_VERSION_MAJOR=8 \ | |
JAVA_VERSION_MINOR=72 \ | |
JAVA_VERSION_BUILD=15 \ | |
JAVA_PACKAGE=jdk \ | |
JAVA_HOME=/opt/jdk \ | |
PATH=${PATH}:/opt/jdk/bin \ | |
LANG=C.UTF-8 | |
# do all in one step | |
RUN apk upgrade --update && \ | |
apk add --update curl ca-certificates bash && \ | |
curl -L -o /tmp/glibc-2.21-r2.apk "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk" && \ | |
apk add --allow-untrusted /tmp/glibc-2.21-r2.apk && \ | |
curl -L -o /tmp/glibc-bin-2.21-r2.apk "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk" && \ | |
apk add --allow-untrusted /tmp/glibc-bin-2.21-r2.apk && \ | |
/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib && \ | |
curl -jksSLH "Cookie: oraclelicense=accept-securebackup-cookie" -o /tmp/java.tar.gz \ | |
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz && \ | |
gunzip /tmp/java.tar.gz && \ | |
tar -C /opt -xf /tmp/java.tar && \ | |
apk del curl && \ | |
ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} /opt/jdk && \ | |
rm -rf /opt/jdk/*src.zip \ | |
/opt/jdk/lib/missioncontrol \ | |
/opt/jdk/lib/visualvm \ | |
/opt/jdk/lib/*javafx* \ | |
/opt/jdk/jre/plugin \ | |
/opt/jdk/jre/bin/javaws \ | |
/opt/jdk/jre/bin/jjs \ | |
/opt/jdk/jre/bin/keytool \ | |
/opt/jdk/jre/bin/orbd \ | |
/opt/jdk/jre/bin/pack200 \ | |
/opt/jdk/jre/bin/policytool \ | |
/opt/jdk/jre/bin/rmid \ | |
/opt/jdk/jre/bin/rmiregistry \ | |
/opt/jdk/jre/bin/servertool \ | |
/opt/jdk/jre/bin/tnameserv \ | |
/opt/jdk/jre/bin/unpack200 \ | |
/opt/jdk/jre/lib/javaws.jar \ | |
/opt/jdk/jre/lib/deploy* \ | |
/opt/jdk/jre/lib/desktop \ | |
/opt/jdk/jre/lib/*javafx* \ | |
/opt/jdk/jre/lib/*jfx* \ | |
/opt/jdk/jre/lib/jfr* \ | |
/opt/jdk/jre/lib/amd64/libdecora_sse.so \ | |
/opt/jdk/jre/lib/amd64/libprism_*.so \ | |
/opt/jdk/jre/lib/amd64/libfxplugins.so \ | |
/opt/jdk/jre/lib/amd64/libglass.so \ | |
/opt/jdk/jre/lib/amd64/libgstreamer-lite.so \ | |
/opt/jdk/jre/lib/amd64/libjavafx*.so \ | |
/opt/jdk/jre/lib/amd64/libjfx*.so \ | |
/opt/jdk/jre/lib/ext/jfxrt.jar \ | |
/opt/jdk/jre/lib/ext/nashorn.jar \ | |
/opt/jdk/jre/lib/oblique-fonts \ | |
/opt/jdk/jre/lib/plugin.jar \ | |
/tmp/* /var/cache/apk/* && \ | |
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf | |
WORKDIR /app | |
COPY build /app | |
WORKDIR /app/install/retel-processing/bin | |
VOLUME /video | |
VOLUME /frames | |
ENTRYPOINT ["./retel-processing"] | |
CMD ["--help"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment