Opentracing/zipkin

Here’s my Dockerfile.

FROM ubuntu:14.04
RUN apt-get update
RUN apt-get install -y wget curl ca-certificates apt-transport-https curl
RUN curl https://packagecloud.io/gpg.key | apt-key add -
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

RUN apt-get update && apt-get install -y ca-certificates
RUN apt-get install -y redis-server
RUN apt-get install -y nginx
RUN apt-get install -y wget
RUN apt-get install -y build-essential
RUN apt-get install -y libluajit-5.1-2
RUN apt-get install -y luarocks
RUN luarocks install lua-cjson

RUN wget https://github.com/google/protobuf/releases/download/v3.1.0/protobuf-python-3.1.0.tar.gz
RUN tar -xvzf protobuf-python-3.1.0.tar.gz
RUN cd protobuf-3.1.0/ &&  ./configure -prefix=/usr && make && make install

RUN apt-get install -y python3-setuptools
RUN apt-get install -y python3-dev
RUN cd protobuf-3.1.0/python && python3 setup.py build --cpp_implementation && python3 setup.py install --cpp_implementation
RUN apt-get install -y libpython3.4
RUN apt-get install -y python3-pip
RUN pip3 install grpcio

RUN echo "deb https://packagecloud.io/tyk/tyk-gateway/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/tyk_tyk-gateway.list

RUN echo "deb-src https://packagecloud.io/tyk/tyk-gateway/ubuntu/ trusty main" | sudo tee -a /etc/apt/sources.list.d/tyk_tyk-gateway.list

RUN apt-get update
RUN apt-get install -y tyk-gateway=2.3.1.2

RUN wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \
    && mv jq-linux64 /usr/local/bin/jq \
    && chmod +x /usr/local/bin/jq

COPY ./tyk.conf /opt/tyk-gateway/tyk.conf
COPY ./run_filter.jq /opt/tyk-gateway/run_filter.jq
COPY ./run.sh /opt/tyk-gateway/run.sh

WORKDIR /opt/tyk-gateway
RUN mkdir -p /opt/tyk-gateway/middleware/bundles
RUN chmod +x run.sh

CMD ["./run.sh"]
EXPOSE 8080

if I exec in to the container and run python3 I note that I cant import gateway at all

root@cd8f23b428ea:/opt/tyk-gateway/coprocess/python/tyk# python3
Python 3.4.3 (default, Nov 17 2016, 01:08:31)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gateway import TykGateway as tyk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'gateway'

gateway.pyx/c/h are in /opt/tyk-gateway/coprocess/python/tyk
should I be building tyk instead?

go build -tags 'coprocess python'.

Thanks for your help

Chris

1 Like