Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
docs(docker): 学习SHELL指令
Browse files Browse the repository at this point in the history
  • Loading branch information
zjZSTU committed Sep 24, 2019
1 parent f849e62 commit fa190c8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/source/docker/dockerfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Dockerfile指令
dockerfile/ADD和COPY
dockerfile/ENTRYPOINT
dockerfile/WORKDIR
dockerfile/ARG
dockerfile/ARG
dockerfile/SHELL
20 changes: 20 additions & 0 deletions docs/source/docker/dockerfile/SHELL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# SHELL

参考:[SHELL](https://docs.docker.com/engine/reference/builder/#shell)

`SHELL`指令在在`Docker1.12`中添加的,重写用于命令的`shell`形式的默认`shell`

对于`Linux`而言是`["/bin/sh", "-c"]`,对于`Windows`而言是`["cmd", "/S", "/C"]`

```
SHELL ["executable", "parameters"]
```

`SHELL`可以在`Dockerfiles`中出现多次,每次`SHELL`指令重写之前的设置,作用于后续的指令

其影响下面`3`个指令的`shell`形式

1. `RUN`
2. `CMD`
3. `ENTRYPOINT`

0 comments on commit fa190c8

Please sign in to comment.