rabin il y a 7 ans
Parent
commit
792c2f0f7d

+ 7 - 0
README.md

@@ -108,6 +108,13 @@ ip:9999
 
 2、机器学习:
 dm run py-note(jupyter+numpy、scipy、matplotlib、pandas、scikit-learn、scrapy、gevent、pymysql、psycopg2)
+2018-01-17更新:增加opencv、dlib库,不过不能使用imshow等前台展示图片的方法。
+使用:
+dm run py-note
+py-note logs 查看token
+访问你的浏览器:ip:10001、ip:10002
+dmlearn install * 可以安装你需要的库,如:
+dmlearn install seaborn
 
 3、elk:
 dm run elk-java(如果之前用了data-java这里就不用再执行了)

+ 7 - 0
src/docker/build/learning/dlib/Dockerfile

@@ -0,0 +1,7 @@
+FROM docker.dever.cc/learning/opencv:latest
+
+MAINTAINER Rabin "https://github.com/shemic"
+
+RUN apk update && apk add --no-cache cmake build-base boost-dev && \
+	pip3 install dlib && \
+	apk del cmake build-base

+ 70 - 0
src/docker/build/learning/opencv/Dockerfile

@@ -0,0 +1,70 @@
+FROM docker.dever.cc/learning:latest
+
+MAINTAINER Rabin "https://github.com/shemic"
+
+ENV CC=/usr/bin/clang
+ENV CXX=/usr/bin/clang++
+
+ENV OPENCV_VERSION=3.3.0
+
+RUN echo -e '@testing http://mirrors.ustc.edu.cn/alpine/edge/testing' >> /etc/apk/repositories
+
+RUN apk update && apk del lapack-dev && apk add --no-cache build-base openblas-dev unzip wget cmake python3-dev \
+	#Intel® TBB, a widely used C++ template library for task parallelism'
+	libtbb@testing  \
+	libtbb-dev@testing   \
+
+	# Wrapper for libjpeg-turbo
+	libjpeg  \
+
+	# accelerated baseline JPEG compression and decompression library
+	libjpeg-turbo-dev \
+
+	# Portable Network Graphics library
+	libpng-dev \
+
+	# A software-based implementation of the codec specified in the emerging JPEG-2000 Part-1 standard (development files)
+	jasper-dev \
+
+	# Provides support for the Tag Image File Format or TIFF (development files)
+	tiff-dev \
+
+	# Libraries for working with WebP images (development files)
+	libwebp-dev \
+
+	# A C language family front-end for LLVM (development files)
+	clang-dev \
+
+	linux-headers && \
+	pip3 install numpy && \
+	mkdir /opt && cd /opt && \
+	wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
+	unzip ${OPENCV_VERSION}.zip && \
+	rm -rf ${OPENCV_VERSION}.zip && \
+	mkdir -p /opt/opencv-${OPENCV_VERSION}/build && \
+	cd /opt/opencv-${OPENCV_VERSION}/build && \
+	cmake \
+	-D CMAKE_BUILD_TYPE=RELEASE \
+	-D CMAKE_INSTALL_PREFIX=/usr/local \
+	-D WITH_FFMPEG=NO \
+	-D WITH_IPP=NO \
+	-D WITH_OPENEXR=NO \
+	-D WITH_TBB=YES \
+	-D BUILD_EXAMPLES=NO \
+	-D BUILD_ANDROID_EXAMPLES=NO \
+	-D INSTALL_PYTHON_EXAMPLES=NO \
+	-D BUILD_DOCS=NO \
+	-D BUILD_opencv_python2=NO \
+	-D BUILD_opencv_python3=ON \
+	-D PYTHON3_EXECUTABLE=/usr/bin/python3 \
+	-D PYTHON3_INCLUDE_DIR=/usr/include/python3.6m/ \
+	-D PYTHON3_LIBRARY=/usr/lib/libpython3.so \
+	-D PYTHON_LIBRARY=/usr/lib/libpython3.so \
+	-D PYTHON3_PACKAGES_PATH=/usr/lib/python3.6/site-packages/ \
+	-D PYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3.6/site-packages/numpy/core/include/ \
+	.. && \
+	make VERBOSE=1 && \
+	make && \
+	make install && \
+	rm -rf /opt/opencv-${OPENCV_VERSION} && \
+	apk del cmake build-base

+ 1 - 1
src/docker/build/learning/scipy/Dockerfile

@@ -1,4 +1,4 @@
-FROM docker.dever.cc/dev/python/v3:latest
+FROM docker.dever.cc/learning/numpy:latest
 
 MAINTAINER Rabin "https://github.com/shemic"
 

+ 14 - 0
src/docker/build/task/airflow/Dockerfile

@@ -0,0 +1,14 @@
+FROM docker.dever.cc/os/alpine/v3.4:latest
+
+MAINTAINER Rabin "https://github.com/shemic"
+
+RUN apk add --no-cache --update nginx
+
+COPY nginx.sh /entrypoint/nginx.sh
+
+VOLUME ["/www", "/etc/nginx", "/var/log/nginx"]
+
+EXPOSE 80
+EXPOSE 443
+
+CMD ["nginx"]

+ 18 - 0
src/docker/build/task/azkaban/Dockerfile

@@ -0,0 +1,18 @@
+FROM docker.dever.cc/os/alpine:latest
+
+MAINTAINER Rabin "https://github.com/shemic"
+
+ENV OR_HOME=/usr/local/openresty
+ENV OR_VERSION=1.13.6.1
+ENV PATH=$PATH:$OR_HOME/bin:$OR_HOME/nginx/sbin
+
+RUN apk add --no-cache --update curl gcc make perl libpcre32 pcre libgcc libressl-dev openssl musl-dev pcre-dev zlib-dev && \
+	curl -O https://openresty.org/download/openresty-${OR_VERSION}.tar.gz && \
+	tar -zxvf openresty-${OR_VERSION}.tar.gz && \
+	cd openresty-${OR_VERSION} && \
+	./configure && \
+	make && make install && \
+	mkdir -p /var/log/nginx && \
+	apk del curl gcc make perl libpcre32 libressl-dev openssl musl-dev pcre-dev
+
+COPY openresty.sh /entrypoint/openresty.sh

+ 1 - 1
src/docker/build/tool/jupyter/Dockerfile

@@ -1,4 +1,4 @@
-FROM docker.dever.cc/learning:latest
+FROM docker.dever.cc/learning/dlib:latest
 
 MAINTAINER Rabin "https://github.com/shemic"
 

+ 9 - 1
src/docker/conf/py.conf

@@ -27,4 +27,12 @@ command = jupyter lab
 
 [phantomjs]
 port = 8910:8910
-command = phantomjs --webdriver=8910
+command = phantomjs --webdriver=8910
+
+[opencv]
+volumes = {container}src/learn:/src
+alias = python3->dmcvpy3,pip3->dmopencv
+
+[dlib]
+volumes = {container}src/learn:/src
+alias = python3->dmdlibpy3,pip3->dmdlib

+ 2 - 0
src/docker/core.conf

@@ -75,6 +75,8 @@ phantomjs			= tool/phantomjs
 
 ;learn
 learn				= learning
+opencv				= learning/opencv
+dlib				= learning/dlib
 
 ;base
 gogs				= base/gogs