diff --git a/components/engine/api/client/commands.go b/components/engine/api/client/commands.go index d60c6d4827..c4ce5e01f3 100644 --- a/components/engine/api/client/commands.go +++ b/components/engine/api/client/commands.go @@ -169,7 +169,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error { } // Now reset the dockerfileName to be relative to the build context - *dockerfileName, err = filepath.Rel(filename, absRoot) + *dockerfileName, err = filepath.Rel(absRoot, filename) if err != nil { return err }