Images之Dockerfile中的命令2
Posted panpanwelcome
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Images之Dockerfile中的命令2相关的知识,希望对你有一定的参考价值。
COPY
COPY has two forms:
COPY [--chown=<user>:<group>] <src>... <dest>
COPY [--chown=<user>:<group>] ["<src>",... "<dest>"]
(this form is required for paths containing whitespace)
Note: The
--chown
feature is only supported on Dockerfiles used to build Linux containers, and will not work on Windows containers. Since user and group ownership concepts do not translate between Linux and Windows, the use of/etc/passwd
and/etc/group
for translating user and group names to IDs restricts this feature to only be viable for Linux OS-based containers.
The COPY
instruction copies new files or directories from <src>
and adds them to the filesystem of the container at the path <dest>
.
Multiple <src>
resources may be specified but the paths of files and directories will be interpreted as relative to the source of the context of the build.
Each <src>
may contain wildcards and matching will be done using Go’s filepath.Match rules. For example:
以上是关于Images之Dockerfile中的命令2的主要内容,如果未能解决你的问题,请参考以下文章