psycopg2/scripts/cpychecker.Dockerfile
Daniele Varrazzo 59e1c368ad Allow running cpychecker on Py3
Also add explicit sha version to check out when new commits added.
2019-02-16 14:44:24 +01:00

47 lines
1.1 KiB
Docker

# docker build -f scripts/cpychecker.Dockerfile --build-arg PYTHON=python2.7 -t cpychecker scripts/
# docker run --rm -ti --name cpychecker --volume `pwd`:/psycopg2 cpychecker
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
g++-6 \
gcc \
gcc-6-plugin-dev \
git \
libpq-dev \
make \
python-lxml \
python-pygments \
python-setuptools \
python-six \
python2.7 \
python2.7-dev \
python3-lxml \
python3-pygments \
python3-setuptools \
python3-six \
python3.6 \
python3.6-dev \
&& rm -rf /var/lib/apt/lists/*
RUN git clone -b psycopg2 https://github.com/dvarrazzo/gcc-python-plugin.git
WORKDIR /gcc-python-plugin
RUN git fetch origin 08d0e644cadd0e6e2d2008ee286e2ea05326148c
RUN git reset --hard FETCH_HEAD
ARG PYTHON
ENV PYTHON=$PYTHON
ENV CC=gcc-6
RUN make PYTHON="$PYTHON" PYTHON_CONFIG="$PYTHON-config" plugin
# expected to be mounted
WORKDIR /psycopg2
ENV CC_FOR_CPYCHECKER=$CC
ENV CC=/gcc-python-plugin/gcc-with-cpychecker
CMD $PYTHON setup.py build
# CMD ["sleep", "infinity"]