mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Builder - dockerfile - just use API for now, and unit test fix
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
98dd1fdca1
commit
735e5d22b7
2 changed files with 4 additions and 9 deletions
|
@ -105,17 +105,11 @@ func (bm *BuildManager) Build(ctx context.Context, config backend.BuildConfig) (
|
|||
}
|
||||
|
||||
os := runtime.GOOS
|
||||
optionsPlatform := system.ParsePlatform(config.Options.Platform)
|
||||
if dockerfile.OS != "" {
|
||||
if optionsPlatform.OS != "" && optionsPlatform.OS != dockerfile.OS {
|
||||
return nil, fmt.Errorf("invalid platform")
|
||||
}
|
||||
os = dockerfile.OS
|
||||
} else if optionsPlatform.OS != "" {
|
||||
os = optionsPlatform.OS
|
||||
apiPlatform := system.ParsePlatform(config.Options.Platform)
|
||||
if apiPlatform.OS != "" {
|
||||
os = apiPlatform.OS
|
||||
}
|
||||
config.Options.Platform = os
|
||||
dockerfile.OS = os
|
||||
|
||||
builderOptions := builderOptions{
|
||||
Options: config.Options,
|
||||
|
|
|
@ -208,6 +208,7 @@ func TestOnbuild(t *testing.T) {
|
|||
func TestWorkdir(t *testing.T) {
|
||||
b := newBuilderWithMockBackend()
|
||||
sb := newDispatchRequest(b, '`', nil, newBuildArgs(make(map[string]*string)), newStagesBuildResults())
|
||||
sb.state.baseImage = &mockImage{}
|
||||
workingDir := "/app"
|
||||
if runtime.GOOS == "windows" {
|
||||
workingDir = "C:\\app"
|
||||
|
|
Loading…
Add table
Reference in a new issue