git “-t,--tag”标志的无效参数“/tensorflow-serving-devel”:无效的参考格式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49357534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Invalid argument "/tensorflow-serving-devel" for "-t,--tag" flag:Invalid reference format
提问by dhinar
I am trying to create a docker Image for tensforflow serving like here.
我正在尝试为这里的tensforflow 服务创建一个 docker 图像。
When i try to pull docker image with all the required dependencies(pip dependencies, bazel, grpc)
当我尝试使用所有必需的依赖项(pip 依赖项、bazel、grpc)拉取 docker 镜像时
What am i doing wrong here? I believe it works for everyone except me. i am using docker toolbox in windows 7 and this is my first time using docker. I don't know what this error says
我在这里做错了什么?我相信它适用于除我之外的所有人。我在 Windows 7 中使用 docker 工具箱,这是我第一次使用 docker。我不知道这个错误说的是什么
edit: after removing the space
Docker version
码头工人版本
回答by nickgryg
There is a typo in your docker build
command: a space is after Dockerfile
word.
您的docker build
命令中有一个错字:Dockerfile
单词后有空格。
The correct command is:
正确的命令是:
docker build --pull -t $USER/tensorflow-serving-devel -f tensorflow_serving/tools/docker/Dockerfile.devel .
EDIT:
编辑:
I see where your problem is. You use Windows, so $USER
is not resolves to username. Please change it to something else like:
我明白你的问题在哪里。您使用的是 Windows,因此$USER
无法解析为用户名。请将其更改为其他内容,例如:
docker build --pull -t user/tensorflow-serving-devel -f tensorflow_serving/tools/docker/Dockerfile.devel .
And then use it with docker run
command:
然后将它与docker run
命令一起使用:
docker run --name=tensorflow_container -it user/tensorflow-serving-devel
回答by yamenk
The problem is that $USER
is expanding to an empty string, since there is no environment variable USER
.
问题是$USER
扩展为空字符串,因为没有环境变量USER
。
To solve the issue just replace the $USER
with your Dockerhub username or any username. You can also just change $USER/tensorflow-serving-devel
to tensorflow-serving-devel
. It really doesn't matter
since this is only the name of the resulting image.
要解决此问题,只需将 替换为$USER
您的 Dockerhub 用户名或任何用户名。您也可以更改$USER/tensorflow-serving-devel
为tensorflow-serving-devel
. 这真的无关紧要,因为这只是结果图像的名称。
回答by Gwen
In my case with the same error, the problem was with combination of "-" and "_" symbols placed together in the image tag. So image tag like MMT-6352_-_fix
is invalid, but image tag like MMT-6352_fix
or MMT-6352-fix
is valid.
在我遇到相同错误的情况下,问题在于图像标签中放置在一起的“ -”和“ _”符号的组合。所以 image tag likeMMT-6352_-_fix
是无效的,但是 image tag like MMT-6352_fix
orMMT-6352-fix
是有效的。