docker_practice/image/dockerfile/shell.md

34 lines
666 B
Go
Raw 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.

# SHELL
`SHELL ["executable", "parameters"]`
`SHELL` `RUN` `ENTRYPOINT` `CMD` shellLinux `["/bin/sh", "-c"]`
```docker
SHELL ["/bin/sh", "-c"]
RUN lll ; ls
SHELL ["/bin/sh", "-cex"]
RUN lll ; ls
```
`RUN` `RUN` 退
`ENTRYPOINT` `CMD` shell `SHELL` shell shell
```docker
SHELL ["/bin/sh", "-cex"]
# /bin/sh -cex "nginx"
ENTRYPOINT nginx
```
```docker
SHELL ["/bin/sh", "-cex"]
# /bin/sh -cex "nginx"
CMD nginx
```