Unix:简单的命令知识
每个令牌在以下命令中指定了什么(关于docker) docker run--rm-它是alpine chown nobody/Unix:简单的命令知识,unix,docker,cmd,Unix,Docker,Cmd,每个令牌在以下命令中指定了什么(关于docker) docker run--rm-它是alpine chown nobody/ 通过运行docker run--help您将看到所有选项及其含义: -i, --interactive Keep STDIN open even if not attached --rm Automatically remove the container
通过运行
docker run--help
您将看到所有选项及其含义:
-i, --interactive Keep STDIN open even if not attached
--rm Automatically remove the container
when it exits
对于chownnobody/
,此命令在容器启动时运行。
此命令将根目录的所有者(别名为/
)更改为usernobody
。该用户是linux发行版中可用的特殊用户
docker run --rm -it alpine chown nobody /
| | || | | |
| | | ------ ------------
| | | | |
Start running a container
| | | |
Delete the container when it's finished running
| | |
Interactive mode, attach to your terminal's stdin
| |
Tag. Runs container tagged `alpine`
|
Run `chown nobody /` inside container
请注意,命令
chown nobody/
不会做任何事情,因为一旦容器退出,更改就会丢失。您所说的“Unix元素”是什么意思?如果您想了解该命令的选项,最好开始阅读“手册页”,因此,请尝试一下man docker
,看看它会把你引向何方……每个文本元素。i、 e.“-它”是什么意思?周恩?没有人有“-”vs“-”吗?好的,如前所述:阅读手册页面。您可能希望显示“chown”之后的所有单词/标记都是传递给“chown”的参数,因为docker可能不会直接使用它们。