Skip to content

Instantly share code, notes, and snippets.

@duglin
Created November 25, 2015 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duglin/b8d2282d7ac8b091beba to your computer and use it in GitHub Desktop.
Save duglin/b8d2282d7ac8b091beba to your computer and use it in GitHub Desktop.
diff --git a/daemon/daemon.go b/daemon/daemon.go
index 6a8d18e..f82bcdb 100644
--- a/daemon/daemon.go
+++ b/daemon/daemon.go
@@ -1236,6 +1236,10 @@ func (daemon *Daemon) ImageHistory(name string) ([]*types
// GetImageID returns an image ID corresponding to the image referred to by
// refOrID.
func (daemon *Daemon) GetImageID(refOrID string) (image.ID, error) {
+ if i := strings.Index(refOrID, ":"); i >= 0 {
+ refOrID = refOrID[i+1:]
+ }
+
// Treat as an ID
if id, err := digest.ParseDigest(refOrID); err == nil {
return image.ID(id), nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment