图片切割镜像的准备 - wanghaisheng/awesome-ocr GitHub Wiki
Dockerfile
[wanghs@db2 tupianqiege]$ cat Dockerfile
FROM alpine:3.3
#FROM 172.10.0.1:5001/datacenter/alpine:3.3
MAINTAINER wanghaisheng <[email protected]>
ENV CPUCOUNT 1
RUN CPUCOUNT=$(cat /proc/cpuinfo | grep '^processor.*:' | wc -l)
RUN echo -e '@edge http://mirrors.ustc.edu.cn/alpine/edge/main\n@testing http://mirrors.ustc.edu.cn/alpine/edge/testing' >> /etc/apk/repositories
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories
RUN apk update && apk upgrade && apk add --update \
python3 \
python3-dev \
make \
cmake \
gcc \
g++ \
pkgconf \
unzip \
wget \
build-base \
gsl \
ffmpeg-dev \
libtbb@testing \
libtbb-dev@testing \
libjpeg \
libjpeg-turbo-dev \
libpng-dev \
libjasper \
clang \
linux-headers\
git
RUN wget "https://bootstrap.pypa.io/get-pip.py" -O - | python3
ENV CC /usr/bin/clang
ENV CXX /usr/bin/clang++
# install numpy from github to get: https://github.com/numpy/numpy/commit/f189e2adcdd05596a6f65b4097e2f12f9c0d9ce9
ADD numpy.patch /numpy.patch
RUN pip install requests cython
RUN curl --insecure https://codeload.github.com/numpy/numpy/tar.gz/maintenance/1.10.x | tar xz \
&& cd numpy-maintenance-1.10.x/numpy/core/src/private/ \
&& patch < /numpy.patch \
&& cd /numpy-maintenance-1.10.x \
&& python3 setup.py install
RUN mkdir opencv-3.1.0 \
# && cd opencv-3.1.0 \
&& git clone https://github.com/Itseez/opencv.git opencv-3.1.0 \
# && cd opencv-3.1.0 \
&& wget https://github.com/Itseez/opencv_3rdparty/blob/ippicv/master_20151201/ippicv/ippicv_linux_20151201.tgz \
&& cp ippicv* /opencv-3.1.0/3rdparty/ippicv/downloads/linux-* \
&& mkdir /opencv-3.1.0/cmake_binary \
&& cd /opencv-3.1.0/cmake_binary \
&& cmake \
-DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DWITH_CUDA=OFF \
-DWITH_1394=OFF \
-DENABLE_AVX=ON \
-DWITH_OPENGL=ON \
-DWITH_OPENCL=ON \
-DWITH_CUFFT=OFF \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DWITH_PTHREADS_PF=OFF \
-DWITH_OPENEXR=OFF \
-DBUILD_opencv_apps=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_PACKAGE=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_WITH_DEBUG_INFO=OFF \
-DENABLE_SSSE3=ON \
-DENABLE_SSE41=ON \
-DENABLE_SSE42=ON \
-DENABLE_POPCNT=ON \
-DENABLE_AVX=ON \
-DENABLE_AVX2=ON \
-DENABLE_NEON=OFF \
-DENABLE_VFPV3=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr \
-DPYTHON_EXECUTABLE=/usr/bin/python3.5 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.5m \
-DPYTHON_PACKAGES_PATH=/usr/lib/python3.5/site-packages \
.. \
&& make -j${CPUCOUNT} install \
&& rm /3.1.0.zip \
&& rm -r /opencv-3.1.0
RUN apk add zlib-dev zlib
RUN CFLAGS="$CFLAGS -L/lib" pip install pillow
RUN pip install PIL
RUN rm -rf /var/cache/apk/*
RUN mkdir -p /root
WORKDIR /root
[wanghs@db2 tupianqiege]$ cat numpy.patch
:100644 100644 fa20eb4... 3e447d7... M numpy/core/src/private/npy_config.h
diff --git a/numpy/core/src/private/npy_config.h b/numpy/core/src/private/npy_config.h
index fa20eb4..3e447d7 100644
--- a/numpy/core/src/private/npy_config.h
+++ b/numpy/core/src/private/npy_config.h
@@ -70,17 +70,13 @@
#endif /* defined(_MSC_VER) && defined(__INTEL_COMPILER) */
-/* Disable broken gnu trig functions on linux */
-#if defined(__linux__) && defined(__GNUC__)
-
+/* Disable broken gnu trig functions */
#if defined(HAVE_FEATURES_H)
#include <features.h>
-#define TRIG_OK __GLIBC_PREREQ(2, 16)
-#else
-#define TRIG_OK 0
-#endif
-#if !TRIG_OK
+#if defined(__GLIBC__)
+#if !__GLIBC_PREREQ(2, 16)
+
#undef HAVE_CASIN
#undef HAVE_CASINF
#undef HAVE_CASINL
@@ -93,9 +89,10 @@
#undef HAVE_CATANH
#undef HAVE_CATANHF
#undef HAVE_CATANHL
-#endif
-#undef TRIG_OK
-#endif /* defined(__linux__) && defined(__GNUC__) */
+#endif /* __GLIBC_PREREQ(2, 16) */
+#endif /* defined(__GLIBC_PREREQ) */
+
+#endif /* defined(HAVE_FEATURES_H) */
#endif
docker build -t datacenter/chopimage .
[wanghs@db2 tupianqiege]$ cat README.md docker build -t datacenter/chopimage .
通过代理
老是卡在ipp这里 考虑设置服务器上的docker在拉取镜像时走叶哥的代理 文档在这里 https://github.com/docker/docker/blob/4a7bd7eaef0038b006cf23adface84081e5aab3b/docs/admin/systemd.md [wanghs@db2 mantl]$ sudo mkdir /etc/systemd/system/docker.service.d [wanghs@db2 mantl]$ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf [wanghs@db2 mantl]$ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
[wanghs@db2 mantl]$ cat /etc/systemd/system/docker.service.d/http-proxy.conf [Service] Environment="ALL_PROXY=socks5://104.224.172.41:538/" "NO_PROXY=localhost,127.0.0.1,http://192.168.27.236:808"
sudo systemctl daemon-reload
sudo systemctl restart docker
https://github.com/docker/docker/pull/18373 https://github.com/docker/docker/pull/20366