bitswamp / python-slim-mysqlclient Goto Github PK
View Code? Open in Web Editor NEWA slim python 3.6 image with mysqlclient wheel
A slim python 3.6 image with mysqlclient wheel
I wrote it in a similar way to you, but I got this error:
ImportError: /usr/local/lib/python3.10/site-packages/MySQLdb/_mysql.cpython-310-x86_64-linux-gnu.so: undefined symbol: TLS_client_method
Could you help me? ๐ญ
My dockerfile:
FROM python:3.10.9-slim AS build
WORKDIR /app
RUN apt-get update && \
apt-get install -y python3-dev default-libmysqlclient-dev build-essential
RUN apt-get install -y git
RUN git clone --branch v2.1.1 --depth 1 https://github.com/PyMySQL/mysqlclient
RUN cd mysqlclient && \
python3 setup.py --static bdist_wheel && \
mkdir /wheel && \
mv ./dist/*.whl /wheel
FROM python:3.10.9-slim AS release
WORKDIR /app
COPY --from=build /wheel /wheel
RUN pip install --no-index --find-links=/wheel mysqlclient
COPY ./dist/project-0.3.0-py3-none-any.whl ./
RUN pip install ./project-0.3.0-py3-none-any.whl
EXPOSE 8000
# CMD [ "pip", "list", "|", "grep", "mysqlclient" ] # make sure mysqlclient is exist
CMD [ "python","-m", "project" ]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.