【发布时间】:2019-02-11 21:04:53
【问题描述】:
我将通过以下 Dockerfile 构建一个 docker 镜像:
FROM python:2.7-alpine
RUN set -ex \
&& apk --no-cache add --virtual build-dependencies \
&& pip install --no-cache-dir mysql-python
它通过以下方式下载包:
Downloading https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108kB)
并执行
python setup.py install
但它失败并返回以下错误:
_mysql.c: In function '_mysql_ConnectionObject_ping':
_mysql.c:2005:41: error: 'MYSQL {aka struct st_mysql}' has no member named 'reconnect'
if ( reconnect != -1 ) self->connection.reconnect = reconnect;
^
error: command 'gcc' failed with exit status 1
但是当我尝试:
FROM python:2.7
它非常有效。 有什么想法吗?
【问题讨论】: