Merge component 'engine' from git@github.com:moby/moby master
This commit is contained in:
@@ -177,6 +177,7 @@ Huu Nguyen <huu@prismskylabs.com> <whoshuu@gmail.com>
|
||||
Hyzhou Zhy <hyzhou.zhy@alibaba-inc.com>
|
||||
Hyzhou Zhy <hyzhou.zhy@alibaba-inc.com> <1187766782@qq.com>
|
||||
Ilya Khlopotov <ilya.khlopotov@gmail.com>
|
||||
Ivan Markin <sw@nogoegst.net> <twim@riseup.net>
|
||||
Jack Laxson <jackjrabbit@gmail.com>
|
||||
Jacob Atzen <jacob@jacobatzen.dk> <jatzen@gmail.com>
|
||||
Jacob Tomlinson <jacob@tom.linson.uk> <jacobtomlinson@users.noreply.github.com>
|
||||
@@ -210,6 +211,7 @@ John Howard (VM) <John.Howard@microsoft.com> <jhoward@ntdev.microsoft.com>
|
||||
John Howard (VM) <John.Howard@microsoft.com> <jhowardmsft@users.noreply.github.com>
|
||||
John Howard (VM) <John.Howard@microsoft.com> <john.howard@microsoft.com>
|
||||
John Stephens <johnstep@docker.com> <johnstep@users.noreply.github.com>
|
||||
Jon Surrell <jon.surrell@gmail.com> <jon.surrell@automattic.com>
|
||||
Jordan Arentsen <blissdev@gmail.com>
|
||||
Jordan Jennings <jjn2009@gmail.com> <jjn2009@users.noreply.github.com>
|
||||
Jorit Kleine-Möllhoff <joppich@bricknet.de> <joppich@users.noreply.github.com>
|
||||
@@ -379,6 +381,7 @@ Stefan Berger <stefanb@linux.vnet.ibm.com>
|
||||
Stefan Berger <stefanb@linux.vnet.ibm.com> <stefanb@us.ibm.com>
|
||||
Stefan J. Wernli <swernli@microsoft.com> <swernli@ntdev.microsoft.com>
|
||||
Stefan S. <tronicum@user.github.com>
|
||||
Stephan Spindler <shutefan@gmail.com> <shutefan@users.noreply.github.com>
|
||||
Stephen Day <stephen.day@docker.com>
|
||||
Stephen Day <stephen.day@docker.com> <stevvooe@users.noreply.github.com>
|
||||
Steve Desmond <steve@vtsv.ca> <stevedesmond-ca@users.noreply.github.com>
|
||||
@@ -436,6 +439,8 @@ Vincent Demeester <vincent.demeester@docker.com> <vincent@sbr.pm>
|
||||
Vishnu Kannan <vishnuk@google.com>
|
||||
Vladimir Rutsky <altsysrq@gmail.com> <iamironbob@gmail.com>
|
||||
Walter Stanish <walter@pratyeka.org>
|
||||
Wang Chao <chao.wang@ucloud.cn>
|
||||
Wang Chao <chao.wang@ucloud.cn> <wcwxyz@gmail.com>
|
||||
Wang Guoliang <liangcszzu@163.com>
|
||||
Wang Jie <wangjie5@chinaskycloud.com>
|
||||
Wang Ping <present.wp@icloud.com>
|
||||
|
||||
@@ -374,6 +374,7 @@ Dan Levy <dan@danlevy.net>
|
||||
Dan McPherson <dmcphers@redhat.com>
|
||||
Dan Stine <sw@stinemail.com>
|
||||
Dan Williams <me@deedubs.com>
|
||||
Dani Louca <dani.louca@docker.com>
|
||||
Daniel Antlinger <d.antlinger@gmx.at>
|
||||
Daniel Dao <dqminh@cloudflare.com>
|
||||
Daniel Exner <dex@dragonslave.de>
|
||||
@@ -740,7 +741,7 @@ Isao Jonas <isao.jonas@gmail.com>
|
||||
Ivan Babrou <ibobrik@gmail.com>
|
||||
Ivan Fraixedes <ifcdev@gmail.com>
|
||||
Ivan Grcic <igrcic@gmail.com>
|
||||
Ivan Markin <twim@riseup.net>
|
||||
Ivan Markin <sw@nogoegst.net>
|
||||
J Bruni <joaohbruni@yahoo.com.br>
|
||||
J. Nunn <jbnunn@gmail.com>
|
||||
Jack Danger Canty <jackdanger@squareup.com>
|
||||
@@ -886,6 +887,7 @@ John V. Martinez <jvmatl@gmail.com>
|
||||
John Warwick <jwarwick@gmail.com>
|
||||
John Willis <john.willis@docker.com>
|
||||
Jon Johnson <jonjohnson@google.com>
|
||||
Jon Surrell <jon.surrell@gmail.com>
|
||||
Jon Wedaman <jweede@gmail.com>
|
||||
Jonas Pfenniger <jonas@pfenniger.name>
|
||||
Jonathan A. Sternberg <jonathansternberg@gmail.com>
|
||||
@@ -1161,6 +1163,7 @@ Matt Hoyle <matt@deployable.co>
|
||||
Matt McCormick <matt.mccormick@kitware.com>
|
||||
Matt Moore <mattmoor@google.com>
|
||||
Matt Richardson <matt@redgumtech.com.au>
|
||||
Matt Rickard <mrick@google.com>
|
||||
Matt Robenolt <matt@ydekproductions.com>
|
||||
Matt Schurenko <matt.schurenko@gmail.com>
|
||||
Matt Williams <mattyw@me.com>
|
||||
@@ -1317,6 +1320,7 @@ Nikolay Milovanov <nmil@itransformers.net>
|
||||
Nirmal Mehta <nirmalkmehta@gmail.com>
|
||||
Nishant Totla <nishanttotla@gmail.com>
|
||||
NIWA Hideyuki <niwa.niwa@nifty.ne.jp>
|
||||
Noah Meyerhans <nmeyerha@amazon.com>
|
||||
Noah Treuhaft <noah.treuhaft@docker.com>
|
||||
noducks <onemannoducks@gmail.com>
|
||||
Nolan Darilek <nolan@thewordnerd.info>
|
||||
@@ -1365,6 +1369,7 @@ Paul Nasrat <pnasrat@gmail.com>
|
||||
Paul Weaver <pauweave@cisco.com>
|
||||
Paulo Ribeiro <paigr.io@gmail.com>
|
||||
Pavel Lobashov <ShockwaveNN@gmail.com>
|
||||
Pavel Pletenev <cpp.create@gmail.com>
|
||||
Pavel Pospisil <pospispa@gmail.com>
|
||||
Pavel Sutyrin <pavel.sutyrin@gmail.com>
|
||||
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
|
||||
@@ -1642,6 +1647,7 @@ Stefan S. <tronicum@user.github.com>
|
||||
Stefan Scherer <scherer_stefan@icloud.com>
|
||||
Stefan Staudenmeyer <doerte@instana.com>
|
||||
Stefan Weil <sw@weilnetz.de>
|
||||
Stephan Spindler <shutefan@gmail.com>
|
||||
Stephen Crosby <stevecrozz@gmail.com>
|
||||
Stephen Day <stephen.day@docker.com>
|
||||
Stephen Drake <stephen@xenolith.net>
|
||||
@@ -1823,7 +1829,7 @@ Vojtech Vitek (V-Teq) <vvitek@redhat.com>
|
||||
waitingkuo <waitingkuo0527@gmail.com>
|
||||
Walter Leibbrandt <github@wrl.co.za>
|
||||
Walter Stanish <walter@pratyeka.org>
|
||||
WANG Chao <wcwxyz@gmail.com>
|
||||
Wang Chao <chao.wang@ucloud.cn>
|
||||
Wang Guoliang <liangcszzu@163.com>
|
||||
Wang Jie <wangjie5@chinaskycloud.com>
|
||||
Wang Long <long.wanglong@huawei.com>
|
||||
@@ -1834,6 +1840,7 @@ Ward Vandewege <ward@jhvc.com>
|
||||
WarheadsSE <max@warheads.net>
|
||||
Wayne Chang <wayne@neverfear.org>
|
||||
Wayne Song <wsong@docker.com>
|
||||
Weerasak Chongnguluam <singpor@gmail.com>
|
||||
Wei Wu <wuwei4455@gmail.com>
|
||||
Wei-Ting Kuo <waitingkuo0527@gmail.com>
|
||||
weiyan <weiyan3@huawei.com>
|
||||
|
||||
@@ -3,7 +3,7 @@ package api // import "github.com/docker/docker/api"
|
||||
// Common constants for daemon and client.
|
||||
const (
|
||||
// DefaultVersion of Current REST API
|
||||
DefaultVersion string = "1.36"
|
||||
DefaultVersion string = "1.37"
|
||||
|
||||
// NoBaseImageSpecifier is the symbol used by the FROM
|
||||
// command to specify that no base image is to be used.
|
||||
|
||||
@@ -373,7 +373,7 @@ func (sr *swarmRouter) createSecret(ctx context.Context, w http.ResponseWriter,
|
||||
return err
|
||||
}
|
||||
version := httputils.VersionFromContext(ctx)
|
||||
if secret.Templating != nil && versions.LessThan(version, "1.36") {
|
||||
if secret.Templating != nil && versions.LessThan(version, "1.37") {
|
||||
return errdefs.InvalidParameter(errors.Errorf("secret templating is not supported on the specified API version: %s", version))
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ func (sr *swarmRouter) createConfig(ctx context.Context, w http.ResponseWriter,
|
||||
}
|
||||
|
||||
version := httputils.VersionFromContext(ctx)
|
||||
if config.Templating != nil && versions.LessThan(version, "1.36") {
|
||||
if config.Templating != nil && versions.LessThan(version, "1.37") {
|
||||
return errdefs.InvalidParameter(errors.Errorf("config templating is not supported on the specified API version: %s", version))
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
timetypes "github.com/docker/docker/api/types/time"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/layer"
|
||||
"github.com/docker/docker/pkg/directory"
|
||||
@@ -193,16 +194,6 @@ func (daemon *Daemon) ImagesPrune(ctx context.Context, pruneFilters filters.Args
|
||||
} else {
|
||||
allImages = daemon.imageStore.Map()
|
||||
}
|
||||
allContainers := daemon.List()
|
||||
imageRefs := map[string]bool{}
|
||||
for _, c := range allContainers {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
default:
|
||||
imageRefs[c.ID] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Filter intermediary images and get their unique size
|
||||
allLayers := make(map[layer.ChainID]layer.Layer)
|
||||
@@ -242,14 +233,8 @@ deleteImagesLoop:
|
||||
default:
|
||||
}
|
||||
|
||||
dgst := digest.Digest(id)
|
||||
hex := dgst.Hex()
|
||||
if _, ok := imageRefs[hex]; ok {
|
||||
continue
|
||||
}
|
||||
|
||||
deletedImages := []types.ImageDeleteResponseItem{}
|
||||
refs := daemon.referenceStore.References(dgst)
|
||||
refs := daemon.referenceStore.References(id.Digest())
|
||||
if len(refs) > 0 {
|
||||
shouldDelete := !danglingOnly
|
||||
if !shouldDelete {
|
||||
@@ -268,17 +253,16 @@ deleteImagesLoop:
|
||||
if shouldDelete {
|
||||
for _, ref := range refs {
|
||||
imgDel, err := daemon.ImageDelete(ref.String(), false, true)
|
||||
if err != nil {
|
||||
logrus.Warnf("could not delete reference %s: %v", ref.String(), err)
|
||||
if imageDeleteFailed(ref.String(), err) {
|
||||
continue
|
||||
}
|
||||
deletedImages = append(deletedImages, imgDel...)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hex := id.Digest().Hex()
|
||||
imgDel, err := daemon.ImageDelete(hex, false, true)
|
||||
if err != nil {
|
||||
logrus.Warnf("could not delete image %s: %v", hex, err)
|
||||
if imageDeleteFailed(hex, err) {
|
||||
continue
|
||||
}
|
||||
deletedImages = append(deletedImages, imgDel...)
|
||||
@@ -309,6 +293,18 @@ deleteImagesLoop:
|
||||
return rep, nil
|
||||
}
|
||||
|
||||
func imageDeleteFailed(ref string, err error) bool {
|
||||
switch {
|
||||
case err == nil:
|
||||
return false
|
||||
case errdefs.IsConflict(err):
|
||||
return true
|
||||
default:
|
||||
logrus.Warnf("failed to prune image %s: %v", ref, err)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// localNetworksPrune removes unused local networks
|
||||
func (daemon *Daemon) localNetworksPrune(ctx context.Context, pruneFilters filters.Args) *types.NetworksPruneReport {
|
||||
rep := &types.NetworksPruneReport{}
|
||||
|
||||
@@ -18,6 +18,10 @@ keywords: "API, Docker, rcli, REST, documentation"
|
||||
[Docker Engine API v1.37](https://docs.docker.com/engine/api/v1.36/) documentation
|
||||
|
||||
* `POST /containers/create` and `POST /services/create` now supports exposing SCTP ports.
|
||||
* `POST /configs/create` and `POST /configs/{id}/create` now accept a `Templating` driver.
|
||||
* `GET /configs` and `GET /configs/{id}` now return the `Templating` driver of the config.
|
||||
* `POST /secrets/create` and `POST /secrets/{id}/create` now accept a `Templating` driver.
|
||||
* `GET /secrets` and `GET /secrets/{id}` now return the `Templating` driver of the secret.
|
||||
|
||||
## v1.36 API changes
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ func DefaultLinuxSpec() specs.Spec {
|
||||
s.Linux = &specs.Linux{
|
||||
MaskedPaths: []string{
|
||||
"/proc/kcore",
|
||||
"/proc/keys",
|
||||
"/proc/latency_stats",
|
||||
"/proc/timer_list",
|
||||
"/proc/timer_stats",
|
||||
|
||||
Reference in New Issue
Block a user