forked from zillow/ctds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-valgrind
80 lines (72 loc) · 2.24 KB
/
Dockerfile-valgrind
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM buildpack-deps:stretch
ARG PYTHON_VERSION=3.6.3
ARG FREETDS_VERSION=1.00.40
#
# Build Python from source for use with valgrind.
#
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# Runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
tcl \
tk \
valgrind \
&& rm -rf /var/lib/apt/lists/*
RUN set -ex \
&& buildDeps=' \
dpkg-dev \
tcl-dev \
tk-dev \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
\
&& wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
&& mkdir -p /usr/src/python \
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
&& rm python.tar.xz \
\
&& cd /usr/src/python \
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
&& ./configure \
--build="$gnuArch" \
--without-pymalloc \
--with-pydebug \
--with-valgrind \
--enable-shared \
--with-system-expat \
--with-system-ffi \
&& make -j "$(nproc)" \
&& make install \
&& ldconfig \
\
&& apt-get purge -y --auto-remove $buildDeps \
\
&& find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' + \
&& rm -rf /usr/src/python
# FreeTDS (required by ctds)
RUN set -ex \
&& wget -O freetds.tar.gz "https://www.freetds.org/files/stable/freetds-${FREETDS_VERSION}.tar.gz" \
&& mkdir -p /usr/src/freetds \
&& tar -xzC /usr/src/freetds --strip-components=1 -f freetds.tar.gz \
&& rm freetds.tar.gz \
&& cd /usr/src/freetds \
&& ./configure \
--disable-odbc \
--disable-apps \
--disable-server \
--disable-pool \
--datarootdir=/usr/src/freetds/data \
--prefix=/usr \
&& make -j "$(nproc)" \
&& make install \
&& rm -rf \
/usr/src/freetds
COPY . /usr/src/ctds/
WORKDIR /usr/src/ctds
CMD ["/bin/bash"]