可以。我已经把截图里的主要 Python 包整理成 pip-only 基础镜像工程 了:
下载 pip 基础镜像工程
这个版本不再用 conda,而是用:
FROM continuumio/miniconda3:24.7.1-0
然后通过:
RUN pip install -r /tmp/build/requirements.txt
安装截图里的 pip 包。
有网机器构建
解压后进入目录,执行:
docker build -f Dockerfile.base -t my-pip-base:1.0 .
验证:
docker run --rm my-pip-base:1.0 python --version
docker run --rm my-pip-base:1.0 pip list
导出:
docker save my-pip-base:1.0 -o my-pip-base-1.0.tar
内网机器使用
把 my-pip-base-1.0.tar 拷贝到内网机器后:
docker load -i my-pip-base-1.0.tar
你的业务镜像就可以直接:
FROM my-pip-base:1.0
WORKDIR /app
COPY . .
CMD ["python", "main.py"]
构建业务镜像:
docker build -t my-app:1.0 .
注意
截图里有些是 conda 底层包、系统库或 Windows 专用包,不能用 pip 安装,例如:
conda
libmamba
libcurl
libffi
sqlite
tk
vc
vc14_runtime
vs2015_runtime
win32-setctime
win_inet_pton
这些没有放进 requirements.txt。Dockerfile 里已经用 apt 安装了 Linux 下常见编译依赖和 MySQL 开发库,方便安装 mysqlclient、aiohttp、greenlet 等包。
addict2.4.0
aiohappyeyeballs2.6.1
aiohttp3.13.5
aiomysql0.3.2
aiosignal1.4.0
aiosqlite0.22.1
annotated-doc0.0.4
annotated-types0.6.0
anyio4.12.1
apscheduler3.11.2
asyncmy0.2.11
attrs26.1.0
banks2.4.2
boltons25.0.0
brotlicffi1.2.0.0
certifi
cffi1.17.1
charset-normalizer3.4.4
click8.2.1
clickhouse-connect0.15.1
colorama0.4.6
cryptography45.0.7
dataclasses-json0.6.7
datetime6.0
deprecated1.3.1
dirtyjson1.0.8
distro1.9.0
et-xmlfile2.0.0
fastapi0.136.1
filetype1.2.0
frozendict2.4.6
frozenlist1.8.0
fsspec2026.4.0
greenlet3.5.0
griffe2.0.2
griffecli2.0.2
griffelib2.0.2
h110.16.0
h24.3.0
hpack4.1.0
httpcore1.0.9
httpx0.28.1
hyperframe6.1.0
idna3.11
jaraco.classes3.4.0
jaraco.context6.1.0
jaraco.functools4.4.0
jieba0.42.1
jinja23.1.6
jiter0.14.0
joblib1.5.3
jsonpatch1.33
jsonpointer3.1.1
keyring25.7.0
langchain1.2.17
langchain-core1.3.2
langchain-protocol0.0.15
langgraph1.1.10
langgraph-checkpoint4.0.3
langgraph-prebuilt1.0.13
langgraph-sdk0.3.13
langsmith0.8.0
llama-index0.14.21
llama-index-core0.14.21
llama-index-embeddings-openai0.6.0
llama-index-instrumentation0.5.0
llama-index-llms-openai0.7.7
llama-index-workflows2.20.0
loguru0.7.3
lz44.4.5
markupsafe3.0.3
marshmallow3.26.2
mcp
more-itertools
msgpack-python
multidict6.7.1
mypy-extensions1.1.0
mysql0.0.3
mysqlclient2.2.8
nest-asyncio1.6.0
networkx3.6.1
nltk3.9.4
openai
platformdirs
pluggy
pycparser
pygments2.20.0
pyjwt2.12.1
pymysql1.1.2
pysocks1.7.1
python-dateutil2.9.0.post0
python-dotenv1.2.1
pytz
pyyaml6.0.3
regex2026.4.4
requests2.33.1
requests-toolbelt1.0.0
rich14.2.0
ruamel.yaml0.18.16
ruamel.yaml.clib0.2.14
semver3.0.4
shellingham1.5.4
six1.17.0
sniffio1.3.1
sqlalchemy2.0.49
sse-starlette3.4.1
starlette1.0.0
tenacity9.1.4
tiktoken0.12.0
tinytag2.2.1
tomli2.4.0
tomlkit0.13.3
tqdm4.67.3
truststore0.10.1
typer0.20.0
typer-slim0.20.0
typing-extensions4.15.0
typing-inspect0.9.0
typing-inspection0.4.2
tzdata
tzlocal5.3.1
urllib32.6.3
uuid-utils0.14.1
uvicorn0.46.0
wrapt2.1.2
xxhash3.7.0
yarl1.23.0
zstandard0.25.0
zope-interface==8.4
pandas
mysql-connector-python
numpy
openpyxl
pillow
pydantic
pydantic_core
scipy
scikit-learn
pycryptodome
elasticsearch-dsl
elasticsearch
pydantic_settings
httpx[http2]
curlify
redis
spacy
emoji
colorlog
langdetect
gunicorn
zhconv