Skip to content

Commit

Permalink
fix push --local error (#52)
Browse files Browse the repository at this point in the history
* Add Log Message

* fix push --local error

local layer path should be "http://xx.xx.xx.xx/local/<image host name>/<repo>/blobs/<sha256>/layer.tar"
  • Loading branch information
lcgkm authored and JG² committed Jun 15, 2017
1 parent 8169b9e commit 4d36dcd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clair/layering.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ func (layers *layering) pushAll() error {

//FIXME Update to TLS
if config.IsLocal {
payload.Layer.Path = strings.Replace(payload.Layer.Path, u.String(), layers.hURL, 1)
local := layers.hURL + "/" + layers.image.Hostname()
payload.Layer.Path = strings.Replace(payload.Layer.Path, u.String(), local, 1)
payload.Layer.Path += "/layer.tar"
}

Expand Down
3 changes: 3 additions & 0 deletions docker/dockercli/dockercli.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func save(imageName string) (distribution.Manifest, error) {
}()

if err != nil {
log.Error(err)
return nil, err
}

Expand All @@ -123,11 +124,13 @@ func save(imageName string) (distribution.Manifest, error) {

err = openAndUntar(path+"/output.tar", path)
if err != nil {
log.Error(err)
return nil, err
}

err = os.Remove(path + "/output.tar")
if err != nil {
log.Error(err)
return nil, err
}
return historyFromManifest(path)
Expand Down

0 comments on commit 4d36dcd

Please # to comment.