-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (22 loc) · 907 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (22 loc) · 907 Bytes
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
FROM python:2.7.15-slim-stretch
COPY requirements.txt /
# Install gcc and libc6-dev in order to install pycrypto
# Install python-dev default-libmysqlclient-dev in order to install MySQLdb
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
apt-get install -y --no-install-recommends gcc libc6-dev python-dev default-libmysqlclient-dev; \
\
pip install --no-cache-dir -r /requirements.txt; \
\
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*;
# libmysqlclient and related packages have been removed above,
# Reinstall default-libmysqlclient-dev, otherwise, MySQLdb will not be available
RUN apt-get update; \
apt-get install -y --no-install-recommends default-libmysqlclient-dev; \
\
rm -rf /var/lib/apt/lists/*;