rabin %!s(int64=7) %!d(string=hai) anos
pai
achega
6e13a403d1

+ 4 - 3
src/docker/build/learning/Dockerfile

@@ -2,11 +2,12 @@ FROM docker.dever.cc/dev/python/v3:latest
 
 MAINTAINER Rabin "https://github.com/shemic"
 
-RUN apk update && apk add --no-cache python3-dev gcc g++ automake lapack lapack-dev gfortran freetype freetype-dev libstdc++ && \
-	pip3 install numpy && \
+RUN apk update && apk add --no-cache freetype lapack gfortran libstdc++
+RUN apk add --no-cache --virtual=.build-deps python3-dev gcc g++ automake lapack-dev freetype-dev && \
+	pip3 install --no-binary=:all: numpy && \
 	pip3 install scipy && \
 	pip3 install pandas && \
 	pip3 install matplotlib && \
 	pip3 install scikit-learn && \
 	pip3 install seaborn && \
-	apk del gcc g++ automake gfortran
+	apk del .build-deps

+ 68 - 0
src/docker/build/learning/tensorflow/Dockerfile

@@ -0,0 +1,68 @@
+FROM docker.dever.cc/learning/opencv:latest
+
+MAINTAINER Rabin "https://github.com/shemic"
+
+ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
+ENV LOCAL_RESOURCES=2048,.5,1.0
+
+ENV BAZEL_VERSION=0.7.0
+ENV TENSORFLOW_VERSION=1.4.0
+
+RUN apk add --no-cache python3-tkinter imagemagick graphviz
+RUN apk add --no-cache --virtual=.build-deps \
+        bash \
+        cmake \
+        curl \
+        freetype-dev \
+        g++ \
+        libjpeg-turbo-dev \
+        libpng-dev \
+        linux-headers \
+        make \
+        musl-dev \
+        openblas-dev \
+        openjdk8 \
+        patch \
+        perl \
+        python3-dev \
+        py-numpy-dev \
+        rsync \
+        sed \
+        swig \
+        zip && \
+    cd /tmp && \
+    pip3 install --no-cache-dir wheel && \
+    curl -SLO https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip && \
+    mkdir bazel-${BAZEL_VERSION} && \
+    unzip -qd bazel-${BAZEL_VERSION} bazel-${BAZEL_VERSION}-dist.zip && \
+    cd bazel-${BAZEL_VERSION} && \
+    sed -i -e '/"-std=c++0x"/{h;s//"-fpermissive"/;x;G}' tools/cpp/cc_configure.bzl && \
+    sed -i -e '/#endif  \/\/ COMPILER_MSVC/{h;s//#else/;G;s//#include <sys\/stat.h>/;G;}' third_party/ijar/common.h && \
+    bash compile.sh && \
+    cp -p output/bazel /usr/bin/ && \
+    cd /tmp && \
+    curl -SL https://github.com/tensorflow/tensorflow/archive/v${TENSORFLOW_VERSION}.tar.gz | tar xzf - && \
+    cd tensorflow-${TENSORFLOW_VERSION} && \
+    sed -i -e '/JEMALLOC_HAVE_SECURE_GETENV/d' third_party/jemalloc.BUILD && \
+    PYTHON_BIN_PATH=/usr/bin/python3 \
+        PYTHON_LIB_PATH=/usr/lib/python3.6/site-packages \
+        CC_OPT_FLAGS="-march=native" \
+        TF_NEED_JEMALLOC=1 \
+        TF_NEED_GCP=0 \
+        TF_NEED_HDFS=0 \
+        TF_NEED_S3=0 \
+        TF_ENABLE_XLA=0 \
+        TF_NEED_GDR=0 \
+        TF_NEED_VERBS=0 \
+        TF_NEED_OPENCL=0 \
+        TF_NEED_CUDA=0 \
+        TF_NEED_MPI=0 \
+        bash configure && \
+    bazel build -c opt --local_resources ${LOCAL_RESOURCES} //tensorflow/tools/pip_package:build_pip_package && \
+    ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg && \
+    cd && \
+    pip3 install --no-cache-dir /tmp/tensorflow_pkg/tensorflow-${TENSORFLOW_VERSION}-cp36-cp36m-linux_x86_64.whl && \
+    pip3 install --no-cache-dir google-api-python-client && \
+    apk del .build-deps && \
+    rm -f /usr/bin/bazel && \
+    rm -rf /tmp/* /root/.cache

+ 16 - 0
src/docker/build/os/ubuntu/sources.list

@@ -0,0 +1,16 @@
+deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
+deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
+deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
+deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
+##测试版源
+deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
+# 源码
+deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
+deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
+deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
+deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
+##测试版源
+deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
+# Canonical 合作伙伴和附加
+deb http://archive.canonical.com/ubuntu/ xenial partner
+deb http://extras.ubuntu.com/ubuntu/ xenial main

+ 3 - 0
src/docker/conf/py.conf

@@ -33,6 +33,9 @@ command = phantomjs --webdriver=8910
 volumes = {container}src/learn:/src
 alias = python3->dmcvpy3,pip3->dmopencv
 
+[tensorflow]
+volumes = {container}src/learn:/src
+
 [dlib]
 volumes = {container}src/learn:/src
 alias = python3->dmdlibpy3,pip3->dmdlib

+ 1 - 0
src/docker/core.conf

@@ -76,6 +76,7 @@ pan					= tool/pan
 ;learn
 learn				= learning
 opencv				= learning/opencv
+tensorflow			= learning/tensorflow
 dlib				= learning/dlib
 
 ;base