首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Docker: Windows 10 -环境似乎没有识别码头脚本

Docker: Windows 10 -环境似乎没有识别码头脚本
EN

Stack Overflow用户
提问于 2020-06-14 16:28:32
回答 1查看 286关注 0票数 0

我正试图在码头学到更多的东西,但在运行命令时遇到了问题,我正在直接从互联网和youtube上复制这些命令。

在这个特殊的例子中,我已经从https://hub.docker.com/_/postgres中提取了postgres映像,它可以直接从获得,没有任何问题,但是当我尝试加载一个示例时,例如:

代码语言:javascript
复制
docker run -p 5432:5432 -d \ 
    -e POSTGRES_PASSWORD=postgres \
    -e POSTGRES_USER=postgres \
    -e POSTGRES_DB=stripe-exmaple \
    -v pgdata:/var/lib/postgresql/data \
    postgres

我遇到一个错误,它在终端中输出这一点:

代码语言:javascript
复制
C:\Program Files\Docker\Docker\resources\bin\docker.exe: invalid reference format.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.
-e : The term '-e' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try again.
At line:2 char:5
+     -e POSTGRES_PASSWORD=postgres \
+     ~~
    + CategoryInfo          : ObjectNotFound: (-e:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-e : The term '-e' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try again.
At line:3 char:5
+     -e POSTGRES_USER=postgres \
+     ~~
    + CategoryInfo          : ObjectNotFound: (-e:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-e : The term '-e' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try again.
At line:4 char:5
+     -e POSTGRES_DB=stripe-exmaple \
+     ~~
    + CategoryInfo          : ObjectNotFound: (-e:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

-v : The term '-v' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 
name, or if a path was included, verify that the path is correct and try again.
At line:5 char:5
+     -v pgdata:/var/lib/postgresql/data \
+     ~~
    + CategoryInfo          : ObjectNotFound: (-v:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

postgres : The term 'postgres' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the 
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:6 char:5
+     postgres
+     ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (postgres:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我似乎能够运行单行映像命令,比如下面部署时没有问题的命令:

代码语言:javascript
复制
docker run --name postgres0 -e POSTGRES_PASSWORD=password -d -p 5432:5432 postgres:alpine

我尝试过:-在管理模式下运行终端/powershell--我尝试在环境变量中添加C:\Program \Docker\Docker\resources\bin\bin\--从C:\Program \Docker\resources\bin**运行终端/powershell并不确定这是否会产生影响--运行,但这使我的膝盖受伤。

我猜这是一个小的windows 10用户错误,但是我完全被困在这里了,希望能从这个cul-de-sac中得到提示。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-14 17:46:47

在这里加起来,这样它就可以被关闭,如果它让你修好了。

你的窗户。字符是linux系统中将命令拆分为多行的一种方法。试着把它们拉出来,把所有的东西都放在一条线上,看看你从哪里开始。如果你想晚些时候打扫干净的话,也许这个。https://superuser.com/questions/1222009/line-break-in-windows-command-prompt

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62375293

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档