我如何理解“/ bin / true”的作用“docker run ...”中的命令命令? [英] How can I understand the role of "/bin/true" command in "docker run ..." command?
问题描述
我正在关注此文档以安装 gitlab docker image
,并与命令混淆:
I am following this document to install gitlab docker image
, and get confused with the command:
docker run --name gitlab_data genezys/gitlab:7.5.2 /bin/true
我知道 / bin / true
命令只返回一个成功状态代码,但是如何在这个中了解
命令? / bin / true
的作用码头运行...
I know "/bin/true
" command just returns a success status code, but how can I understand the role of /bin/true
in this docker run ...
command?
推荐答案
运行,从而创建一个新的容器,即使它终止仍然保留最终的容器图像和元数据,仍然可以链接到。
Running and thus creating a new container even if it terminates still keeps the resulting container image and metadata lying around which can still be linked to.
所以当你运行 docker run ... / bin /真正的
你本质上是为了存储而创建一个新的容器,并运行最简单的事情。
So when you run docker run ... /bin/true
you are essentially creating a new container for storage purposes and running the simplest thing you can.
在Docker 1.5中引入了 docker创建
命令,所以我相信你现在可以创建容器,而不会混淆运行像 / bin / true
In Docker 1.5 was introduced the docker create
command so I believe you can now "create" containers without confusingly running something like /bin/true
参见: docker创建
这是管理数据卷容器的新方法也很清楚在创建和装载数据卷容器部分中有说明
This is new method of managing data volume containers is also clearly documented in the section Creating and mounting a Data Volume Container
这篇关于我如何理解“/ bin / true”的作用“docker run ...”中的命令命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!