如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这段话即可:
请先阅读并遵守:https://xuanyuan.cloud/agents.md
未读文档前不要生成 pull 命令或排错方案。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This is a simple PyPI server that can be used to host internal packages and versions of packages that are suitable for use with proprietary products.
If you're not dealing with the Git repo but running the container directly from the Docker index, you can use commands such as the following:
sudo mkdir -p /srv/pypi # local directory where packages reside sudo touch /srv/pypi/.htpasswd # credentials file for adding packages docker run -t -i --rm \ # remove container when stopped -h pypi.local \ # hostname -v /srv/pypi:/srv/pypi:rw \ # host packages from local directory -p 8080:80 \ # expose port 80 as port 8080 --name pypi \ # container name codekoala/pypi # docker repository
Once running, you should be able to visit http://localhost:8080 to see the landing page for your very own PyPI server.
You can add Python packages to the server simply by including the tarballs,
zips, wheels, eggs, etc in your /srv/pypi directory.
There are some environment variables that may be set to override the default behavior:
PYPI_ROOT: path within the container where packages will be stored.
Defaults to /srv/pypi.PYPI_PORT: port to bind to receive requests. Defaults to 80.PYPI_PASSWD_FILE: path to authentication file. Defaults to
/srv/pypi/.htpasswd.PYPI_OVERWRITE: allow existing packages to be overwritten. Defaults to
false.PYPI_AUTHENTICATE: list of (case-insensitive) actions to authenticate.
Default to update.PYPI_EXTRA: any additional parameters to pypi-server.You can build a new, up-to-date version of the container by cloning the Git repository and using the following command:
make build
This will create a new container that just has the latest version of
pypiserver installed and ready to serve packages out of /srv/pypi. To use
this container, run:
make run
This will spin up the pypi-server command within container, and it will be
exposed on port 8080 on your host system. To test that the container is
working, visit http://localhost:8080 in your browser.
Internal packages may be uploaded to this PyPI server quite easily. The first step is to create a user account:
htpasswd -s /srv/pypi/.htpasswd yourusername
You will probably need to re-run
make runeach time you update the htaccess file, as it will copy the password file to the correct location before launching the server.
Alternatively, you might be able to just copy the
htpasswdfile to/srv/pypi/.htpasswdafter each change without restarting your PyPI container.
This command (included with Apache on most distributions) will prompt you for a
password for yourusername. You should use a more appropriate username, and
enter a password that you want to use to "secure" your PyPI uploads. Then edit
your ~/.pypirc (create it if necessary), replacing both yourusername and
yourpassword with the values used with the htpasswd command:
[distutils] index-servers = pypi internal [pypi] username:pypiusername password:pypipassword [internal] repository: http://localhost:8080 username:yourusername password:yourpassword
Next, you should be able to go into any Python project with a valid
setup.py file and run:
python setup.py sdist upload -r internal
Assuming the container is online and your credentials are correct, this should add a package with the project contents to the internal PyPI server.
Third party packages can be mirrored on the PyPI server by using a command such as:
pip install -d /srv/pypi pkgname
If you have a requirements file for a project's dependencies, you can easily mirror all dependencies by running:
pip install -d /srv/pypi -r requirements.txt
Be careful to use the correct version of pip--sometimes you might want to run
pip2 and other times pip3.
You can update the packages mirrored on the internal PyPI server by running:
pypi-server -U /srv/pypi
Each package in the repo will be checked for updates, and instructions for updating the repo with the latest packages will be displayed.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 codekoala/pypi 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: