You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: docker_validator.go
    path of file: ./repos/kubernetes/vendor/k8s.io/system-validators/validators
    
    the code of the file until where you have to start completion: /*
Copyright 2016 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package system

import (
	"bytes"
	"encoding/json"
	"os/exec"
	"regexp"
	"strings"

	"github.com/pkg/errors"
)

var _ Validator = &DockerValidator{}

// DockerValidator validates docker 
    
func (d *DockerValidator) Validate(spec SysSpec) ([]error, []error) {
	if spec.RuntimeSpec.DockerSpec == nil {
		// If DockerSpec is not specified, assume current runtime is not
		// docker, skip the docker configuration validation.
		return nil, nil
	}

	// Run 'docker info' with a JSON output and unmarshal it into a dockerInfo object
	info := dockerInfo{}
	cmd := exec.Command("docker", "info", "--format", "{{json .}}")

	// Stderr can contain warnings despite docker info success.
	var outb, errb bytes.Buffer
	cmd.Stdout = &outb
	cmd.Stderr = &errb
	err := cmd.Run()
	if err != nil {
		return nil, []error{errors.Errorf(`failed executing "docker info --format '{{json .}}'"\noutput: %s\nstderr: %s\nerror: %v`, outb.String(), errb.String(), err)}
	}
	if err := d.unmarshalDockerInfo(outb.Bytes(), &info); err != nil {
		return nil, []error{err}
	}

	// validate the resulted docker info object against the spec
	warnings, errs := d.validateDockerInfo(spec.RuntimeSpec.DockerSpec, info)

	if len(errb.String()) > 0 {
		warnings = append(warnings, errors.Errorf(`the command "docker info --format '{{json.}}'" succeeded with potential warnings\noutput: %s`, errb.String()))
	}
	return warnings, errs
}