docker exec或docker容器exec [英] docker exec or docker container exec

查看:145
本文介绍了docker exec或docker容器exec的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在最新的Docker CLI文档中注意到Docker CLI命令列表已扩展。
如果我以前使用 docker exec 在容器内部启动可执行文件,我现在也可以使用 docker container exec 命令。

I noticed in the latest Docker CLI documentation that Docker CLI command list has expanded. If I used docker exec earlier to start executable inside container now I can also use docker container exec command.

docker container run 命令类似于 docker run 等。

因此,首选哪个命令现在?旧语法还是新Docker容器语法?不幸的是,我在文档中找不到任何解释。

So which commands are preferrable now? Old syntax or new docker container syntax? Unfortunately I couldn't find any explanation in the docs.

此外,docker container run和docker container create命令之间有什么区别?在docker container stop和docker container kill之间?描述和语法非常相似。

Also what is the difference between docker container run and docker container create commands? And between docker container stop and docker container kill? The description and syntax are very similar.

谢谢。

推荐答案

随着docker功能的不断发展和新命令的添加,cli需要进行一些重新设计。您将来应该使用docker容器exec来兼容,但是docker exec实际上是别名,因此在有人决定弃用它之前,它也应该起作用。如果您有兴趣,可以从此PR开始阅读有关此更改的信息: https://github.com / moby / moby / pull / 26025

As docker grew in features over time and new commands were added cli needed some redesign. You should use docker container exec to be compatible in the future, but docker exec is in fact an alias so until someone decided to deprecate it should also work. If you are interested, you can start reading about this change from this PR: https://github.com/moby/moby/pull/26025

这篇关于docker exec或docker容器exec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆