From 20793b05eeb1b83c0bd5cc89017cb3e2b5f814e5 Mon Sep 17 00:00:00 2001 From: felix Date: Tue, 3 Sep 2019 13:52:27 +0800 Subject: [PATCH] update dockerfiles --- Dockerfiles/alpine.Dockerfile | 14 ++++++++------ Dockerfiles/buster.Dockerfile | 11 ++++++----- Dockerfiles/ubuntu18.Dockerfile | 9 +++++---- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Dockerfiles/alpine.Dockerfile b/Dockerfiles/alpine.Dockerfile index b4998d4d..b55f9c3f 100644 --- a/Dockerfiles/alpine.Dockerfile +++ b/Dockerfiles/alpine.Dockerfile @@ -9,16 +9,18 @@ LABEL maintainer="team@gnes.ai" \ org.label-schema.build-date=$BUILD_DATE \ org.label-schema.name="GNES is Generic Nerual Elastic Search" -WORKDIR /gnes/ - -ADD . ./ - RUN apk add --no-cache \ --virtual=.build-dependencies \ build-base g++ gfortran file binutils zeromq-dev \ musl-dev python3-dev py-pgen cython openblas-dev && \ - apk add --no-cache libstdc++ openblas libzmq && \ - ln -s locale.h /usr/include/xlocale.h && \ + apk add --no-cache libstdc++ openblas libzmq + + +WORKDIR /gnes/ + +ADD . ./ + +RUN ln -s locale.h /usr/include/xlocale.h && \ pip install . --no-cache-dir --compile && \ find /usr/lib/python3.7/ -name 'tests' -exec rm -r '{}' + && \ find /usr/lib/python3.7/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \; && \ diff --git a/Dockerfiles/buster.Dockerfile b/Dockerfiles/buster.Dockerfile index d66fab7c..42333aa0 100644 --- a/Dockerfiles/buster.Dockerfile +++ b/Dockerfiles/buster.Dockerfile @@ -9,17 +9,18 @@ LABEL maintainer="team@gnes.ai" \ org.label-schema.build-date=$BUILD_DATE \ org.label-schema.name="GNES is Generic Nerual Elastic Search" +RUN apt-get update && apt-get install --no-install-recommends -y \ + build-essential \ + python3-dev libopenblas-dev && \ + apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* + WORKDIR /gnes/ ADD . ./ -RUN apt-get update && apt-get install --no-install-recommends -y \ - build-essential \ - python3-dev libopenblas-dev && \ - ln -s locale.h /usr/include/xlocale.h && \ +RUN ln -s locale.h /usr/include/xlocale.h && \ pip install . --no-cache-dir --compile && \ rm -rf /tmp/* && rm -rf /gnes && \ - apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* && \ rm /usr/include/xlocale.h WORKDIR / diff --git a/Dockerfiles/ubuntu18.Dockerfile b/Dockerfiles/ubuntu18.Dockerfile index ab58a1dc..1fb17ef0 100644 --- a/Dockerfiles/ubuntu18.Dockerfile +++ b/Dockerfiles/ubuntu18.Dockerfile @@ -18,16 +18,17 @@ ENV LANG=en_US.UTF-8 \ LANGUAGE=en_US:en \ LC_ALL=en_US.UTF-8 -ADD . ./ - RUN apt-get update && apt-get install --no-install-recommends -y \ build-essential python3-dev python3-pip python3-setuptools libopenblas-dev && \ export LC_ALL=en_US.UTF-8 && export LANG=en_US.UTF-8 && export LC_CTYPE=en_US.UTF-8 && \ ln -s /usr/bin/python3 python && \ - pip3 install . --no-cache-dir --compile && \ - rm -rf /tmp/* && rm -rf /gnes && \ apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* +ADD . ./ + +RUN pip3 install . --no-cache-dir --compile && \ + rm -rf /tmp/* && rm -rf /gnes + WORKDIR / ENTRYPOINT ["gnes"] \ No newline at end of file