-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.grpc_with_eventlet.ubuntu
53 lines (44 loc) · 2.24 KB
/
Dockerfile.grpc_with_eventlet.ubuntu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM ubuntu:latest
# Install build tools
# RUN yum install -y python3-pip gcc-c++ git python3-devel openssl-devel
RUN apt update && apt upgrade -y && apt install -y build-essential python3-pip git python-is-python3
# Need to upgrade pip and setuptools
RUN pip3 install --upgrade pip setuptools
# Try building new GCC version, gcc-c++ fails?
#ENV GCC_VERSION=10.3.0
#RUN dnf update -y && \
# dnf -y group install "Development Tools" && \
# yum config-manager --set-enabled powertools && \
# dnf -y install libmpc-devel && \
# curl -O http://gnu.mirror.constant.com/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.gz && \
# tar zxf gcc-$GCC_VERSION.tar.gz && \
# mkdir gcc-build && cd gcc-build && \
# ../gcc-$GCC_VERSION/configure --enable-languages=c,c++ --disable-multilib && \
# make -j$(nproc) && make install && \
# ln -sf /usr/local/bin/gcc /usr/bin/gcc-10 && \
# ln -sf /usr/local/bin/g++ /usr/bin/g++-10
# RUN yum install -y gcc-toolset-10-gcc-c++
# Install Bazel build tool
RUN apt install apt-transport-https curl gnupg && \
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg && \
mv bazel.gpg /etc/apt/trusted.gpg.d/ && \
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \
apt update && apt install -y bazel
# Build gRPC with eventlet support
# TODO use separate build image and copy only resulting binaries
# Follow these instructions: https://github.com/grpc/grpc/tree/master/src/python/grpcio
# removed: sudo pip3 install -r requirements.bazel.txt && \
# Try: python3 -m pip install --compiler=/usr/local/bin/gcc .
# Works: https://github.com/grpc/grpc.git
# Broken: git clone https://github.com/jbemmel/grpc.git && \
RUN cd /tmp && \
git clone https://github.com/grpc/grpc.git && \
cd grpc && \
git submodule update --init && \
pip3 install -r requirements.txt
# Split for now
COPY ./src /opt/srlinux/agents/
# RUN cd /tmp/grpc && GRPC_PYTHON_BUILD_WITH_CYTHON=1 CC=/usr/bin/gcc CXX=/usr/bin/g++ python3 -m pip install .
# RUN cd /tmp/grpc && GRPC_PYTHON_BUILD_WITH_CYTHON=1 python3 -m pip install --no-clean --verbose --log /tmp/pip.log .
# which python -> empty? need python-is-python3
RUN cd /tmp/grpc && bazel build :python3