diff --git a/commands.go b/commands.go index 16f97f12dd..2b54578bf7 100644 --- a/commands.go +++ b/commands.go @@ -425,15 +425,19 @@ func (srv *Server) CmdPush(stdin io.ReadCloser, stdout io.Writer, args ...string remote = local } + Debugf("Pushing [%s] to [%s]\n", local, remote) + // Try to get the image // FIXME: Handle lookup // FIXME: Also push the tags in case of ./docker push myrepo:mytag // img, err := srv.runtime.LookupImage(cmd.Arg(0)) img, err := srv.runtime.graph.Get(local) if err != nil { + Debugf("The push refers to a repository [%s] (len: %d)\n", local, len(srv.runtime.repositories.Repositories[local])) + // If it fails, try to get the repository if localRepo, exists := srv.runtime.repositories.Repositories[local]; exists { - fmt.Fprintf(stdout, "Pushing %s (%d images) on %s...\n", local, len(localRepo), remote) + fmt.Fprintf(stdout, "Pushing %s (%d tags) on %s...\n", local, len(localRepo), remote) if err := srv.runtime.graph.PushRepository(remote, localRepo, srv.runtime.authConfig); err != nil { return err } diff --git a/registry.go b/registry.go index 3d4c0e904f..4eb1e07cf0 100644 --- a/registry.go +++ b/registry.go @@ -370,9 +370,10 @@ func (graph *Graph) pushPrimitive(remote, tag, imgId string, authConfig *auth.Au // Remote has the format '/ func (graph *Graph) PushRepository(remote string, localRepo Repository, authConfig *auth.AuthConfig) error { // Check if the remote repository exists - if !graph.LookupRemoteRepository(remote, authConfig) { - return fmt.Errorf("The remote repository %s does not exist\n", remote) - } + // FIXME: @lopter How to handle this? + // if !graph.LookupRemoteRepository(remote, authConfig) { + // return fmt.Errorf("The remote repository %s does not exist\n", remote) + // } // For each image within the repo, push them for tag, imgId := range localRepo {