More descriptive error message for missing docker image.

Tested:
  Ran a packetimpact test after `docker image rm` and examined the message.
PiperOrigin-RevId: 308370603
This commit is contained in:
Eyal Soha
2020-04-24 20:00:24 -07:00
committed by gVisor bot
parent 15a822a193
commit c9199bab92
+4 -1
View File
@@ -353,7 +353,10 @@ func (d *Docker) run(r RunOpts, command string, p ...string) (string, error) {
// Create calls 'docker create' with the arguments provided.
func (d *Docker) Create(r RunOpts, args ...string) error {
_, err := d.run(r, "create", args...)
out, err := d.run(r, "create", args...)
if strings.Contains(out, "Unable to find image") {
return fmt.Errorf("unable to find image, did you remember to `make load-%s`: %w", r.Image, err)
}
return err
}