如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Develop Miniconda applications in Python 3. Installs dependencies from your environment.yml file and the Python extension.
| Metadata | Value |
|---|---|
| Categories | Core, Languages |
| Image type | Dockerfile |
| Published image | mcr.microsoft.com/devcontainers/miniconda:3 |
| Published image architecture(s) | x86-64 |
| Container host OS support | Linux, macOS, Windows |
| Container OS | Debian |
| Languages, platforms | Python, Anaconda, Miniconda |
See https://github.com/devcontainers/images/tree/main/src/miniconda/history for information on the contents of published images.
You can directly reference pre-built versions of .devcontainer/Dockerfile by using the image property in .devcontainer/devcontainer.json or updating the FROM statement in your own Dockerfile to the following. An example Dockerfile is included in this repository.
mcr.microsoft.com/devcontainers/miniconda (or miniconda:3)Refer to https://containers.dev/guide/dockerfile for more details.
You can decide how often you want updates by referencing a https://semver.org/ of each image. For example:
mcr.microsoft.com/devcontainers/miniconda:1-3mcr.microsoft.com/devcontainers/miniconda:1.3-3mcr.microsoft.com/devcontainers/miniconda:1.3.2-3See https://github.com/devcontainers/images/tree/main/src/miniconda/history for information on the contents of each version and here for a complete list of available tags.
Alternatively, you can use the contents of https://github.com/devcontainers/images/tree/main/src/miniconda/.devcontainer to fully customize your container's contents or to build it for a container host architecture not supported by the image.
This dev container and its associated image includes https://aka.ms/vscode-remote/conda/about. Additional packages installed using Conda will be downloaded from Anaconda or another repository if you configure one. To reconfigure Conda in this container to access an alternative repository, please see information on https://aka.ms/vscode-remote/conda/channel-setup.
Access to the Anaconda repository is covered by the https://aka.ms/vscode-remote/conda/terms, which may require some organizations to obtain a commercial license from Anaconda. However, when this dev container or its associated image is used with GitHub Codespaces or GitHub Actions, all users are permitted to use the Anaconda Repository through the service, including organizations normally required by Anaconda to obtain a paid license for commercial activities. Note that third-party packages may be licensed by their publishers in ways that impact your intellectual property, and are used at your own risk.
Using the forwardPorts property
By default, frameworks like Flask only listens to localhost inside the container. As a result, we recommend using the forwardPorts property (available in v0.98.0+) to make these ports available locally.
json"forwardPorts": [5000]
The appPort property https://docs.docker.com/config/containers/container-networking/#published-ports rather than forwards the port, so applications need to listen to * or 0.0.0.0 for the application to be accessible externally. This conflicts with the defaults of some Python frameworks, but fortunately the forwardPorts property does not have this limitation.
Installing Node.js
Given JavaScript front-end web client code written for use in conjunction with a Python back-end often requires the use of Node.js-based utilities to build, you can use a https://github.com/devcontainers/features/tree/main/src/node to install any version of Node by adding the following to devcontainer.json:
json{ "features": { "ghcr.io/devcontainers/features/node:1": { "version": "latest" } } }
Using different Conda channels
This image is based on the ContinuumIO/miniconda3 docker image, which has the conda and its dependencies (installed from conda's default channel) in the base environment. It is not recommended to install packages from different channels in one environment since it could cause conflicts. When installing a package from a different channel (e.g., conda-forge) is required, the better approach is to create a new conda environment.
Installing or updating Python utilities
This container installs all Python development utilities using https://pipxproject.github.io/pipx/ to avoid impacting the global Python environment. You can use this same utility add additional utilities in an isolated environment. For example:
bashpipx install prospector
Note that if you change the version of Python from the default, you'll need to run a few commands to update the utilities and pipx. More on that next.
Installing a different version of Python
As covered in the https://docs.anaconda.com/anaconda/user-guide/faq for Anaconda, you can install different versions of Python than the one in this image by running the following from a terminal:
bashconda install python=3.6 pip install --no-cache-dir pipx pipx uninstall pipx pipx reinstall-all
Or in a Dockerfile:
DockerfileRUN conda install -y python=3.6 \ && pip install --no-cache-dir pipx \ && pipx uninstall pipx \ && pipx reinstall-all
See the https://pipxproject.github.io/pipx/docs/ for additional information.
For convenience, this image will automatically install dependencies from the environment.yml file in the parent folder when the container is built. You can change this behavior by altering this line in the Dockerfile:
DockerfileRUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \ && rm -rf /tmp/conda-tmp
The dev container spec images are maintained in the https://github.com/devcontainers/images repo. You can explore each image and open issues or feature requests.
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See https://github.com/devcontainers/images/blob/main/LICENSE
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务
以下是 microsoft/devcontainers-miniconda 相关的常用 Docker 镜像,适用于 不同场景 等不同场景: