code: func (cli *Client) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
  	query, err := cli.imageBuildOptionsToQuery(options)
  	if err != nil {
  		return types.ImageBuildResponse{}, err
  	}
  
  	headers := http.Header(make(map[string][]string))
  	buf, err := json.Marshal(options.AuthConfigs)
  	if err != nil {
  		return types.ImageBuildResponse{}, err
  	}
  	headers.Add("X-Registry-Config", base64.URLEncoding.EncodeToString(buf))
  
  	headers.Set("Content-Type", "application/x-tar")
  
  	serverResp, err := cli.postRaw(ctx, "/build", query, buildContext, headers)
  	if err != nil {
  		return types.ImageBuildResponse{}, err
  	}
  
  	osType := getDockerOS(serverResp.header.Get("Server"))
  
  	return types.ImageBuildResponse{
  		Body:   serverResp.body,
  		OSType: osType,
  	}, nil
  }
docs: // ImageBuild sends request to the daemon to build images.
  // The Body in the response implement an io.ReadCloser and it's up to the caller to
  // close it.