mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Enabling expose support for Windows TP5
Signed-off-by: msabansal <sabansal@microsoft.com> Upstream-commit: 4982a732f34640217d05eee255905fcb12a7f939 Component: engine
This commit is contained in:
@@ -21,7 +21,6 @@ package dockerfile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/builder/dockerfile/command"
|
||||
@@ -200,16 +199,3 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
|
||||
|
||||
return fmt.Errorf("Unknown instruction: %s", upperCasedCmd)
|
||||
}
|
||||
|
||||
// platformSupports is a short-term function to give users a quality error
|
||||
// message if a Dockerfile uses a command not supported on the platform.
|
||||
func platformSupports(command string) error {
|
||||
if runtime.GOOS != "windows" {
|
||||
return nil
|
||||
}
|
||||
switch command {
|
||||
case "expose", "user", "stopsignal", "arg":
|
||||
return fmt.Errorf("The daemon on this platform does not support the command '%s'", command)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
9
components/engine/builder/dockerfile/evaluator_unix.go
Normal file
9
components/engine/builder/dockerfile/evaluator_unix.go
Normal file
@@ -0,0 +1,9 @@
|
||||
// +build !windows
|
||||
|
||||
package dockerfile
|
||||
|
||||
// platformSupports is a short-term function to give users a quality error
|
||||
// message if a Dockerfile uses a command not supported on the platform.
|
||||
func platformSupports(command string) error {
|
||||
return nil
|
||||
}
|
||||
26
components/engine/builder/dockerfile/evaluator_windows.go
Normal file
26
components/engine/builder/dockerfile/evaluator_windows.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// +build windows
|
||||
|
||||
package dockerfile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/Microsoft/hcsshim"
|
||||
)
|
||||
|
||||
// platformSupports is a short-term function to give users a quality error
|
||||
// message if a Dockerfile uses a command not supported on the platform.
|
||||
func platformSupports(command string) error {
|
||||
switch command {
|
||||
// TODO Windows TP5. Expose can be removed from here once TP4 is
|
||||
// no longer supported.
|
||||
case "expose":
|
||||
if !hcsshim.IsTP4() {
|
||||
break
|
||||
}
|
||||
fallthrough
|
||||
case "user", "stopsignal", "arg":
|
||||
return fmt.Errorf("The daemon on this platform does not support the command '%s'", command)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user