"docker容器运行"至少需要 1 个参数 [英] "docker container run" requires at least 1 argument
本文介绍了"docker容器运行"至少需要 1 个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用我已经创建的卷创建一个容器,但我的控制台显示错误
I'm trying to create a container using a volume that I have already created, but my console shows the error
docker container run"至少需要1个参数
这是我试图运行的命令:
This is the command I'm trying to run:
docker container run --name db -v volume-dados-do-banco:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=Mypass
我也试过这个,有更多的参数,但同样的错误仍然存在:
I have also tried this one, wih more arguments, but the same error persists:
docker container run -d --name db -p 3306:3306 -e 'ACCEPT_EULA=Y' -e MYSQL_ROOT_PASSWORD=Mypass -v volume-dados-do-banco:/var/lib/mysql
对发生这种情况的原因有什么想法吗?
Any thoughts on the reason why this is happening?
推荐答案
我刚刚重新启动了 docker 并运行:
I just restarted docker and ran:
docker run --name torgmysqldb --volumes-from volume-dados-banco-mysql -e MYSQL_ROOT_PASSWORD=Mypass -p 3307:3306 mysql
我发现了一个关于此的已知问题:https://github.com/docker/for-win/issues/2722
I found out a known issue about this: https://github.com/docker/for-win/issues/2722
这篇关于"docker容器运行"至少需要 1 个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文