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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:05:00  来源:igfitidea点击:

Invalid argument "/tensorflow-serving-devel" for "-t,--tag" flag:Invalid reference format

gitdockertensorflowgit-clonetensorflow-serving

提问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) enter image description here

当我尝试使用所有必需的依赖项(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 enter image description here

编辑:删除空格后 在此处输入图片说明

Docker version

码头工人版本

enter image description here

在此处输入图片说明

回答by nickgryg

There is a typo in your docker buildcommand: a space is after Dockerfileword.

您的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 $USERis 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 runcommand:

然后将它与docker run命令一起使用:

docker run --name=tensorflow_container -it user/tensorflow-serving-devel

回答by yamenk

The problem is that $USERis expanding to an empty string, since there is no environment variable USER.

问题是$USER扩展为空字符串,因为没有环境变量USER

To solve the issue just replace the $USERwith your Dockerhub username or any username. You can also just change $USER/tensorflow-serving-develto tensorflow-serving-devel. It really doesn't matter since this is only the name of the resulting image.

要解决此问题,只需将 替换为$USER您的 Dockerhub 用户名或任何用户名。您也可以更改$USER/tensorflow-serving-develtensorflow-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_-_fixis invalid, but image tag like MMT-6352_fixor MMT-6352-fixis valid.

在我遇到相同错误的情况下,问题在于图像标签中放置在一起的“ -”和“ _”符号的组合。所以 image tag likeMMT-6352_-_fix是无效的,但是 image tag like MMT-6352_fixorMMT-6352-fix是有效的。