Windows: Allow user in builder
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit a3c4ab9b65
)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
902774c871
commit
530b7cb4a0
2 changed files with 18 additions and 1 deletions
|
@ -6,7 +6,7 @@ import "fmt"
|
|||
// a command not supported on the platform.
|
||||
func platformSupports(command string) error {
|
||||
switch command {
|
||||
case "user", "stopsignal":
|
||||
case "stopsignal":
|
||||
return fmt.Errorf("The daemon on this platform does not support the command '%s'", command)
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -7266,3 +7266,20 @@ func (s *DockerSuite) TestBuildOpaqueDirectory(c *check.C) {
|
|||
_, err := buildImage("testopaquedirectory", dockerFile, false)
|
||||
c.Assert(err, checker.IsNil)
|
||||
}
|
||||
|
||||
// Windows test for USER in dockerfile
|
||||
func (s *DockerSuite) TestBuildWindowsUser(c *check.C) {
|
||||
testRequires(c, DaemonIsWindows)
|
||||
name := "testbuildwindowsuser"
|
||||
_, out, err := buildImageWithOut(name,
|
||||
`FROM `+WindowsBaseImage+`
|
||||
RUN net user user /add
|
||||
USER user
|
||||
RUN set username
|
||||
`,
|
||||
true)
|
||||
if err != nil {
|
||||
c.Fatal(err)
|
||||
}
|
||||
c.Assert(strings.ToLower(out), checker.Contains, "username=user")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue