请教个 docker 环境问题

2020-08-11 17:28:42 +08:00
 DaFee

docker alpine:3.8 环境安装 openssl-dev 和 mariadb-connector-c-dev 显示 conflicts,有啥其他解决办法吗?

需求:两个包都必须安全 dev 版,mariadb-connector-c-dev 是为了解决 pip 安装 mysqlclient 的问题,openssl-dev 是解决 DTLS 的问题。

Dockerfile

FROM alpine:3.8
# Install dependencies
RUN apk add --no-cache git tcpdump ipmitool build-base python3-dev py3-pip py3-cffi libxml2-dev libxslt-dev libffi-dev openssl-dev mariadb-connector-c-dev

RUN adduser -s /bin/bash -D conpot
WORKDIR /opt/
RUN git clone --depth=1 https://github.com/mushorg/conpot.git
RUN chown conpot:conpot -R /opt/conpot

# Install Python requirements
USER conpot
WORKDIR /opt/conpot
RUN pip3 install --user --no-cache-dir --upgrade pip setuptools
RUN pip3 install --user --no-cache-dir coverage
RUN pip3 install --user --no-cache-dir -r requirements.txt

# Install the Conpot application
RUN python3 setup.py install --user --prefix=
ENV PATH=$PATH:/home/conpot/.local/bin
RUN py.test -v
1512 次点击
所在节点    Docker
2 条回复
julyclyde
2020-08-12 10:08:01 +08:00
试试用 pymysql 代替?纯 python 实现的 mysql 客户端库,支持 monkeypatch
DaFee
2020-08-12 13:46:12 +08:00
@julyclyde 那个 requirements.txt 里面写的是 mysqlclient,我准备把 alpine 换成 ubuntu 试试。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/697437

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX