
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
This (hopefully) gives you everything you need to compile WebAssembly modules written in C, Rust, or Emscripten (WAT). Some additional Ubuntu apt packages are installed to satisfy build requirements. This image compressed comes to 2GB, but with its base layers the total on disk is 4.69GB. Compiling this yourself will use less bandwidth but can take several hours. Feedback? Discuss: [***]
To use, docker run -it --rm -v .:/project wasm/toolchain:latest /bin/bash --login or something similar, where:
docker run spins up the container from the image-it specifies that you want an interactive TTY--rm tells it to remove this temporary image when it exits-v . mounts a volume on this directory and :/project makes a project directory within the container mapped to it/bin/bash --login tells the container to run a login bash shell inside the containerThis should drop you in to the container with access to your files (you did run this command from within your wasm project folder's root directory, yes?) where you can cd /project and then rustc myfile.rs or whatever you feel compelled to do at that point. :)
Successful build achieved with this Dockerfile Sunday, July 15, 2018:
# vim:set ft=dockerfile: FROM ubuntu:latest RUN set -x \ && apt-get update \ && apt-get upgrade -y \ && apt-get dist-upgrade -y \ && apt-get autoclean \ && apt-get autoremove \ && apt-get install bash python2.7 nodejs cmake curl git gcc clang default-jre -y SHELL ["/bin/bash", "-c"] RUN set -x \ && git clone https://github.com/juj/emsdk.git \ && cd emsdk \ && ./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit \ && ./emsdk activate --build=Release sdk-incoming-64bit binaryen-master-64bit \ && . ./emsdk_env.sh --build=Release \ && curl https://sh.rustup.rs -sSf -o rustup.rs.sh \ && /bin/sh ./rustup.rs.sh -y ENV PATH="/root/.cargo/bin:${PATH}" RUN set -x \ && rustup update \ && rustup install nightly \ && rustup target add wasm32-unknown-unknown --toolchain nightly RUN set -x \ && cargo +nightly install wasm-bindgen-cli # References # EMSDK https://webassembly.org/getting-started/developers-guide/ # https://rustwasm.github.io/book/game-of-life/setup.html#setup
.:/project probably won't work for you. Specify a full path to the folder on your drive, e.g.:
docker run -it --rm -v C:\Users\David\MyWasmProjectExample:/project wasm/toolchain:latest /bin/bash --login
If you get an error that your drive is not shared, open Docker's settings and add the drive you're atte***ing to share under the "Shared Drives" settings.
(Example Windows Drive Sharing Error:
CSee 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.```) See also: https://hub.docker.com/r/webassembly/toolchain/ which is the same but has a slightly longer name and a :dx tag that includes emacs, screen, zsh, htop, etc. Unofficial build by @DavidCanHelp
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务