You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker执行run命令提示‘invalid reference format’错误求助

Fixing Docker's "invalid reference format" Error for Your Command

Hey there, let's work through this Docker error you're hitting—those "invalid reference format" messages can be tricky, but I bet we can nail it down quickly.

First off, the most likely culprit in your command is incorrect dash characters: you're using long em dashes (—) for flags like —name and —rm, but Docker requires standard ASCII hyphens (-). This is a super common typo, especially if you copied the command from a formatted document or word processor that auto-replaces dashes.

Here's the fixed command with proper hyphens:

docker run --name my_app -it --rm -v "$(pwd):/service" nuadu_app python run_script/hello_world.py

If that doesn't resolve it right away, here are a few more checks to run:

  • Verify that the image name nuadu_app is valid: no spaces, unescaped special characters, and that the image actually exists on your local machine (or in a registry you have access to).
  • If you're on Windows using PowerShell, the $(pwd) syntax might need adjustment—try ${PWD} instead, or use a Linux-style path like /c/Users/your/path for the volume mount.
  • Double-check for accidental extra spaces in the command: sometimes a stray space can make Docker misinterpret part of your command as an invalid image reference.

Start with the corrected command first—that's almost certainly the fix here. Let me know if you still run into issues!

内容的提问来源于stack exchange,提问作者nexla

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:24:34