docker_practice/image/dockerfile/add.md

33 lines
2.2 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# ADD
`ADD` `COPY` `COPY`
`<源路径>` `URL`Docker `<目标路径>` `600` `RUN` `RUN` 使 `RUN` 使 `wget` `curl` 使
`<源路径>` `tar` `gzip`, `bzip2` `xz` `ADD` `<目标路径>`
`ubuntu`
```docker
FROM scratch
ADD ubuntu-xenial-core-cloudimg-amd64-root.tar.gz /
...
```
使 `ADD`
Docker [Dockerfile ](../../appendix/best_practices.md) 使 `COPY` `COPY` `ADD` 使 `ADD`
`ADD`
`COPY` `ADD` 使 `COPY` 使 `ADD`
使 `--chown=<user>:<group>`
```docker
ADD --chown=55:mygroup files* /mydir/
ADD --chown=bin files* /mydir/
ADD --chown=1 files* /mydir/
ADD --chown=10:11 files* /mydir/
```