From 195f009f5bb271564956cf48f17ca7b9d59e6c4f Mon Sep 17 00:00:00 2001 From: bicijinlian Date: Tue, 18 Jan 2022 00:53:19 +0800 Subject: [PATCH] =?UTF-8?q?shell=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Build/学习.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Build/学习.md b/Build/学习.md index f848e87..c9472fc 100644 --- a/Build/学习.md +++ b/Build/学习.md @@ -601,6 +601,24 @@ docker run -p 80:80/tcp -p 80:80/udp ... > > 对于当前镜像的构建没有一点影响;在子镜像构建时默认执行。 ++ SHELL + + > 该指令允许覆盖用于命令的 shell 形式的默认*shell*. linux默认为 + > + > `["/bin/sh", "-c"]` windows默认为`["cmd", "/S", "/C"]` + > + > + > + > ```dockerfile + > FROM microsoft/nanoserver + > SHELL ["powershell","-command"] + > RUN New-Item -ItemType Directory C:\Example + > ADD Execute-MyCmdlet.ps1 c:\example\ + > RUN c:\example\Execute-MyCmdlet -sample 'hello world' + > ``` + > + > + + 小结 暂无