Skip to content
Permalink
Browse files

revert(docker): revert alpine docker to reduce size

  • Loading branch information...
hanxiao committed Sep 12, 2019
1 parent 9c1a606 commit cc72cf2b59d973343a526c0009b3b1cf8389a186
Showing with 12 additions and 10 deletions.
  1. +8 −9 Dockerfiles/alpine.Dockerfile
  2. +4 −1 gnes/service/frontend.py
@@ -9,25 +9,24 @@ LABEL maintainer="team@gnes.ai" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="GNES is Generic Nerual Elastic Search"

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


WORKDIR /gnes/

ADD . ./

RUN ln -s locale.h /usr/include/xlocale.h && \
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 && \
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 "{}"' \; && \
rm /usr/include/xlocale.h && \
rm -rf /tmp/* && \
rm -rf /gnes && \
apk del .build-dependencies
apk del .build-dependencies && \
rm -rf /var/cache/apk/*

WORKDIR /

@@ -17,8 +17,9 @@
import threading
from concurrent.futures import ThreadPoolExecutor

import grpc

import grpc
from .. import __version__, __proto_version__
from ..client.base import ZmqClient
from ..helper import set_logger
from ..proto import gnes_pb2_grpc, gnes_pb2, router2str
@@ -66,6 +67,8 @@ def add_envelope(self, body: 'gnes_pb2.Request', zmq_client: 'ZmqClient'):
msg.envelope.part_id = 1
msg.envelope.num_part.append(1)
msg.envelope.timeout = 5000
msg.envelope.gnes_version = __version__
msg.envelope.proto_version = __proto_version__
r = msg.envelope.routes.add()
r.service = FrontendService.__name__
r.timestamp.GetCurrentTime()

0 comments on commit cc72cf2

Please sign in to comment.
You can’t perform that action at this time.