From 25f42443f1c14fd877089fd826f6077f1ef5c3fb Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Mon, 25 Apr 2016 11:07:04 -0700 Subject: [PATCH 01/22] Bump version to 1.11.1 Signed-off-by: Kenfe-Mickael Laventure --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 1cac385c6cb86..720c7384c6195 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.11.0 +1.11.1 From 9d99e360ba40b73c09a5cb41b66fcdbfbf8ccfff Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Mon, 11 Apr 2016 17:29:17 -0700 Subject: [PATCH 02/22] Vendor distribution to correct config blob media type in schema2 manifest @nwt noticed that the media type specified in the config section of a schema2 manifest is application/octet-stream, instead of the correct value application/vnd.docker.container.image.v1+json. This brings in https://github.com/docker/distribution/pull/1622 to fix this. Signed-off-by: Aaron Lehmann (cherry picked from commit c18d03a7783bb78b7568bf3c23644888995e9a5d) --- distribution/pull_v2.go | 3 +- distribution/push_v2.go | 2 +- hack/vendor.sh | 2 +- .../github.com/docker/distribution/.drone.yml | 38 ------------ .../github.com/docker/distribution/.mailmap | 1 + .../github.com/docker/distribution/AUTHORS | 15 +++++ .../github.com/docker/distribution/Dockerfile | 3 +- .../github.com/docker/distribution/Makefile | 62 ++++++++++++++----- .../github.com/docker/distribution/README.md | 2 +- .../github.com/docker/distribution/circle.yml | 16 +++-- .../docker/distribution/context/util.go | 16 ++--- .../docker/distribution/coverpkg.sh | 2 +- .../manifest/manifestlist/manifestlist.go | 10 ++- .../distribution/manifest/schema2/builder.go | 3 + .../docker/distribution/registry.go | 14 +++++ .../distribution/registry/api/v2/urls.go | 29 +++++---- .../registry/client/repository.go | 29 +++------ 17 files changed, 134 insertions(+), 113 deletions(-) delete mode 100644 vendor/src/github.com/docker/distribution/.drone.yml diff --git a/distribution/pull_v2.go b/distribution/pull_v2.go index ecddc170b796a..748ef422b301f 100644 --- a/distribution/pull_v2.go +++ b/distribution/pull_v2.go @@ -17,7 +17,6 @@ import ( "github.com/docker/distribution/manifest/schema1" "github.com/docker/distribution/manifest/schema2" "github.com/docker/distribution/registry/api/errcode" - "github.com/docker/distribution/registry/client" "github.com/docker/distribution/registry/client/auth" "github.com/docker/distribution/registry/client/transport" "github.com/docker/docker/distribution/metadata" @@ -338,7 +337,7 @@ func (p *v2Puller) pullV2Tag(ctx context.Context, ref reference.Named) (tagUpdat // NOTE: not using TagService.Get, since it uses HEAD requests // against the manifests endpoint, which are not supported by // all registry versions. - manifest, err = manSvc.Get(ctx, "", client.WithTag(tagged.Tag())) + manifest, err = manSvc.Get(ctx, "", distribution.WithTag(tagged.Tag())) if err != nil { return false, allowV1Fallback(err) } diff --git a/distribution/push_v2.go b/distribution/push_v2.go index e812c1da8c392..e86badb47299b 100644 --- a/distribution/push_v2.go +++ b/distribution/push_v2.go @@ -166,7 +166,7 @@ func (p *v2Pusher) pushV2Tag(ctx context.Context, ref reference.NamedTagged, ima return err } - putOptions := []distribution.ManifestServiceOption{client.WithTag(ref.Tag())} + putOptions := []distribution.ManifestServiceOption{distribution.WithTag(ref.Tag())} if _, err = manSvc.Put(ctx, manifest, putOptions...); err != nil { logrus.Warnf("failed to upload schema2 manifest: %v - falling back to schema1", err) diff --git a/hack/vendor.sh b/hack/vendor.sh index 59dc5b1c8038b..7ef5bf0384720 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -49,7 +49,7 @@ clone git github.com/boltdb/bolt v1.2.0 clone git github.com/miekg/dns 75e6e86cc601825c5dbcd4e0c209eab180997cd7 # get graph and distribution packages -clone git github.com/docker/distribution d06d6d3b093302c02a93153ac7b06ebc0ffd1793 +clone git github.com/docker/distribution 467fc068d88aa6610691b7f1a677271a3fac4aac clone git github.com/vbatts/tar-split v0.9.11 # get desired notary commit, might also need to be updated in Dockerfile diff --git a/vendor/src/github.com/docker/distribution/.drone.yml b/vendor/src/github.com/docker/distribution/.drone.yml deleted file mode 100644 index d943e19ff18e5..0000000000000 --- a/vendor/src/github.com/docker/distribution/.drone.yml +++ /dev/null @@ -1,38 +0,0 @@ -image: dmp42/go:stable - -script: - # To be spoofed back into the test image - - go get github.com/modocache/gover - - - go get -t ./... - - # Go fmt - - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" - # Go lint - - test -z "$(golint ./... | tee /dev/stderr)" - # Go vet - - go vet ./... - # Go test - - go test -v -race -cover ./... - # Helper to concatenate reports - - gover - # Send to coverall - - goveralls -service drone.io -coverprofile=gover.coverprofile -repotoken {{COVERALLS_TOKEN}} - - # Do we want these as well? - # - go get code.google.com/p/go.tools/cmd/goimports - # - test -z "$(goimports -l -w ./... | tee /dev/stderr)" - # http://labix.org/gocheck - -notify: - email: - recipients: - - distribution@docker.com - - slack: - team: docker - channel: "#dt" - username: mom - token: {{SLACK_TOKEN}} - on_success: true - on_failure: true diff --git a/vendor/src/github.com/docker/distribution/.mailmap b/vendor/src/github.com/docker/distribution/.mailmap index e4e50ee7938af..f0452da619432 100644 --- a/vendor/src/github.com/docker/distribution/.mailmap +++ b/vendor/src/github.com/docker/distribution/.mailmap @@ -13,3 +13,4 @@ Sharif Nassar Sharif Nassar Sven Dowideit Vincent Giersch Vincent Giersch davidli davidli +Omer Cohen Omer Cohen \ No newline at end of file diff --git a/vendor/src/github.com/docker/distribution/AUTHORS b/vendor/src/github.com/docker/distribution/AUTHORS index a44266b0c24f6..0857b62fc9751 100644 --- a/vendor/src/github.com/docker/distribution/AUTHORS +++ b/vendor/src/github.com/docker/distribution/AUTHORS @@ -8,12 +8,15 @@ Alex Elman amitshukla Amy Lindburg Andrew Meredith +Andrew T Nguyen Andrey Kostov Andy Goldstein Anton Tiurin Antonio Mercado +Antonio Murdaca Arnaud Porterie Arthur Baars +Asuka Suzuki Avi Miller Ayose Cazorla BadZen @@ -37,7 +40,9 @@ Diogo Mónica DJ Enriquez Donald Huang Doug Davis +Eric Yang farmerworking +Felix Yan Florentin Raud Frederick F. Kautz IV gabriell nascimento @@ -45,29 +50,36 @@ harche Henri Gomez Hu Keping Hua Wang +HuKeping Ian Babrou +igayoso Jack Griffin Jason Freidman Jeff Nickoloff Jessie Frazelle Jianqing Wang +John Starks Jon Poler Jonathan Boulle Jordan Liggitt Josh Hawn Julien Fernandez +Keerthan Mala Kelsey Hightower Kenneth Lim Kenny Leung Li Yi Liu Hua +liuchang0812 Louis Kottmann Luke Carpenter Mary Anthony Matt Bentley +Matt Duch Matt Moore Matt Robenolt Michael Prokop +Michal Minar Miquel Sabaté Morgan Bauer moxiegirl @@ -78,6 +90,7 @@ Nuutti Kotivuori Oilbeater Olivier Gambier Olivier Jacques +Omer Cohen Patrick Devine Philip Misiowiec Richard Scothern @@ -90,6 +103,7 @@ Shawn Falkner-Horine Shreyas Karnik Simon Thulbourn Spencer Rinehart +Stefan Weil Stephen J Day Sungho Moon Sven Dowideit @@ -111,3 +125,4 @@ xg.song xiekeyang Yann ROBERT yuzou +姜继忠 diff --git a/vendor/src/github.com/docker/distribution/Dockerfile b/vendor/src/github.com/docker/distribution/Dockerfile index 0ab9629e50886..abb3e3bbf8424 100644 --- a/vendor/src/github.com/docker/distribution/Dockerfile +++ b/vendor/src/github.com/docker/distribution/Dockerfile @@ -1,11 +1,10 @@ -FROM golang:1.5.3 +FROM golang:1.6 RUN apt-get update && \ apt-get install -y apache2-utils && \ rm -rf /var/lib/apt/lists/* ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution -ENV GOPATH $DISTRIBUTION_DIR/Godeps/_workspace:$GOPATH ENV DOCKER_BUILDTAGS include_oss include_gcs WORKDIR $DISTRIBUTION_DIR diff --git a/vendor/src/github.com/docker/distribution/Makefile b/vendor/src/github.com/docker/distribution/Makefile index 2ba01083a7350..a0602d0b2c012 100644 --- a/vendor/src/github.com/docker/distribution/Makefile +++ b/vendor/src/github.com/docker/distribution/Makefile @@ -15,7 +15,7 @@ GO_LDFLAGS=-ldflags "-X `go list ./version`.Version=$(VERSION)" .PHONY: clean all fmt vet lint build test binaries .DEFAULT: all -all: fmt vet fmt lint build test binaries +all: fmt vet lint build test binaries AUTHORS: .mailmap .git/HEAD git log --format='%aN <%aE>' | sort -fu > $@ @@ -24,51 +24,83 @@ AUTHORS: .mailmap .git/HEAD version/version.go: ./version/version.sh > $@ -${PREFIX}/bin/registry: version/version.go $(shell find . -type f -name '*.go') +# Required for go 1.5 to build +GO15VENDOREXPERIMENT := 1 + +# Package list +PKGS := $(shell go list -tags "${DOCKER_BUILDTAGS}" ./... | grep -v ^github.com/docker/distribution/vendor/) + +# Resolving binary dependencies for specific targets +GOLINT := $(shell which golint || echo '') +GODEP := $(shell which godep || echo '') + +${PREFIX}/bin/registry: $(wildcard **/*.go) @echo "+ $@" @go build -tags "${DOCKER_BUILDTAGS}" -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/registry -${PREFIX}/bin/digest: version/version.go $(shell find . -type f -name '*.go') +${PREFIX}/bin/digest: $(wildcard **/*.go) @echo "+ $@" @go build -tags "${DOCKER_BUILDTAGS}" -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/digest -${PREFIX}/bin/registry-api-descriptor-template: version/version.go $(shell find . -type f -name '*.go') +${PREFIX}/bin/registry-api-descriptor-template: $(wildcard **/*.go) @echo "+ $@" @go build -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/registry-api-descriptor-template docs/spec/api.md: docs/spec/api.md.tmpl ${PREFIX}/bin/registry-api-descriptor-template ./bin/registry-api-descriptor-template $< > $@ -# Depends on binaries because vet will silently fail if it can't load compiled -# imports -vet: binaries +vet: @echo "+ $@" - @go vet ./... + @go vet -tags "${DOCKER_BUILDTAGS}" $(PKGS) fmt: @echo "+ $@" - @test -z "$$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | tee /dev/stderr)" || \ - echo "+ please format Go code with 'gofmt -s'" + @test -z "$$(gofmt -s -l . 2>&1 | grep -v ^vendor/ | tee /dev/stderr)" || \ + (echo >&2 "+ please format Go code with 'gofmt -s'" && false) lint: @echo "+ $@" - @test -z "$$(golint ./... | grep -v Godeps/_workspace/src/ | tee /dev/stderr)" + $(if $(GOLINT), , \ + $(error Please install golint: `go get -u github.com/golang/lint/golint`)) + @test -z "$$($(GOLINT) ./... 2>&1 | grep -v ^vendor/ | tee /dev/stderr)" build: @echo "+ $@" - @go build -tags "${DOCKER_BUILDTAGS}" -v ${GO_LDFLAGS} ./... + @go build -tags "${DOCKER_BUILDTAGS}" -v ${GO_LDFLAGS} $(PKGS) test: @echo "+ $@" - @go test -test.short -tags "${DOCKER_BUILDTAGS}" ./... + @go test -test.short -tags "${DOCKER_BUILDTAGS}" $(PKGS) test-full: @echo "+ $@" - @go test ./... + @go test -tags "${DOCKER_BUILDTAGS}" $(PKGS) binaries: ${PREFIX}/bin/registry ${PREFIX}/bin/digest ${PREFIX}/bin/registry-api-descriptor-template @echo "+ $@" clean: @echo "+ $@" - @rm -rf "${PREFIX}/bin/registry" "${PREFIX}/bin/registry-api-descriptor-template" + @rm -rf "${PREFIX}/bin/registry" "${PREFIX}/bin/digest" "${PREFIX}/bin/registry-api-descriptor-template" + +dep-save: + @echo "+ $@" + $(if $(GODEP), , \ + $(error Please install godep: go get github.com/tools/godep)) + @$(GODEP) save $(PKGS) + +dep-restore: + @echo "+ $@" + $(if $(GODEP), , \ + $(error Please install godep: go get github.com/tools/godep)) + @$(GODEP) restore -v + +dep-validate: dep-restore + @echo "+ $@" + @rm -Rf .vendor.bak + @mv vendor .vendor.bak + @rm -Rf Godeps + @$(GODEP) save ./... + @test -z "$$(diff -r vendor .vendor.bak 2>&1 | tee /dev/stderr)" || \ + (echo >&2 "+ borked dependencies! what you have in Godeps/Godeps.json does not match with what you have in vendor" && false) + @rm -Rf .vendor.bak diff --git a/vendor/src/github.com/docker/distribution/README.md b/vendor/src/github.com/docker/distribution/README.md index cc55884e61247..c21d47243aebc 100644 --- a/vendor/src/github.com/docker/distribution/README.md +++ b/vendor/src/github.com/docker/distribution/README.md @@ -17,7 +17,7 @@ This repository contains the following components: |**Component** |Description | |--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | **registry** | An implementation of the [Docker Registry HTTP API V2](docs/spec/api.md) for use with docker 1.6+. | -| **libraries** | A rich set of libraries for interacting with,distribution components. Please see [godoc](https://godoc.org/github.com/docker/distribution) for details. **Note**: These libraries are **unstable**. | +| **libraries** | A rich set of libraries for interacting with distribution components. Please see [godoc](https://godoc.org/github.com/docker/distribution) for details. **Note**: These libraries are **unstable**. | | **specifications** | _Distribution_ related specifications are available in [docs/spec](docs/spec) | | **documentation** | Docker's full documentation set is available at [docs.docker.com](https://docs.docker.com). This repository [contains the subset](docs/index.md) related just to the registry. | diff --git a/vendor/src/github.com/docker/distribution/circle.yml b/vendor/src/github.com/docker/distribution/circle.yml index f658d111b35f8..3d1ffd2f06acb 100644 --- a/vendor/src/github.com/docker/distribution/circle.yml +++ b/vendor/src/github.com/docker/distribution/circle.yml @@ -8,7 +8,7 @@ machine: post: # go - - gvm install go1.5.3 --prefer-binary --name=stable + - gvm install go1.6 --prefer-binary --name=stable environment: # Convenient shortcuts to "common" locations @@ -49,26 +49,30 @@ test: # - gvm use old && go version - gvm use stable && go version + # Ensure validation of dependencies + - gvm use stable && if test -n "`git diff --stat=1000 master | grep -Ei \"vendor|godeps\"`"; then make dep-validate; fi: + pwd: $BASE_STABLE + # First thing: build everything. This will catch compile errors, and it's # also necessary for go vet to work properly (see #807). - - gvm use stable && godep go install ./...: + - gvm use stable && godep go install $(go list ./... | grep -v "/vendor/"): pwd: $BASE_STABLE # FMT - - gvm use stable && test -z "$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | tee /dev/stderr)": + - gvm use stable && make fmt: pwd: $BASE_STABLE # VET - - gvm use stable && go vet ./...: + - gvm use stable && make vet: pwd: $BASE_STABLE # LINT - - gvm use stable && test -z "$(golint ./... | grep -v Godeps/_workspace/src/ | tee /dev/stderr)": + - gvm use stable && make lint: pwd: $BASE_STABLE override: # Test stable, and report - - gvm use stable; export ROOT_PACKAGE=$(go list .); go list -tags "$DOCKER_BUILDTAGS" ./... | xargs -L 1 -I{} bash -c 'export PACKAGE={}; godep go test -tags "$DOCKER_BUILDTAGS" -test.short -coverprofile=$GOPATH/src/$PACKAGE/coverage.out -coverpkg=$(./coverpkg.sh $PACKAGE $ROOT_PACKAGE) $PACKAGE': + - gvm use stable; export ROOT_PACKAGE=$(go list .); go list -tags "$DOCKER_BUILDTAGS" ./... | grep -v "/vendor/" | xargs -L 1 -I{} bash -c 'export PACKAGE={}; godep go test -tags "$DOCKER_BUILDTAGS" -test.short -coverprofile=$GOPATH/src/$PACKAGE/coverage.out -coverpkg=$(./coverpkg.sh $PACKAGE $ROOT_PACKAGE) $PACKAGE': timeout: 600 pwd: $BASE_STABLE diff --git a/vendor/src/github.com/docker/distribution/context/util.go b/vendor/src/github.com/docker/distribution/context/util.go index 299edc0045754..cb9ef52e38e7a 100644 --- a/vendor/src/github.com/docker/distribution/context/util.go +++ b/vendor/src/github.com/docker/distribution/context/util.go @@ -8,25 +8,17 @@ import ( // since that time. If the key is not found, the value returned will be zero. // This is helpful when inferring metrics related to context execution times. func Since(ctx Context, key interface{}) time.Duration { - startedAtI := ctx.Value(key) - if startedAtI != nil { - if startedAt, ok := startedAtI.(time.Time); ok { - return time.Since(startedAt) - } + if startedAt, ok := ctx.Value(key).(time.Time); ok { + return time.Since(startedAt) } - return 0 } // GetStringValue returns a string value from the context. The empty string // will be returned if not found. func GetStringValue(ctx Context, key interface{}) (value string) { - stringi := ctx.Value(key) - if stringi != nil { - if valuev, ok := stringi.(string); ok { - value = valuev - } + if valuev, ok := ctx.Value(key).(string); ok { + value = valuev } - return value } diff --git a/vendor/src/github.com/docker/distribution/coverpkg.sh b/vendor/src/github.com/docker/distribution/coverpkg.sh index 7ee751ab6eea1..25d419ae82658 100755 --- a/vendor/src/github.com/docker/distribution/coverpkg.sh +++ b/vendor/src/github.com/docker/distribution/coverpkg.sh @@ -3,5 +3,5 @@ # need to be passed to `go test -coverpkg`: this includes all of the # subpackage's dependencies within the containing package, as well as the # subpackage itself. -DEPENDENCIES="$(go list -f $'{{range $f := .Deps}}{{$f}}\n{{end}}' ${1} | grep ${2})" +DEPENDENCIES="$(go list -f $'{{range $f := .Deps}}{{$f}}\n{{end}}' ${1} | grep ${2} | grep -v github.com/docker/distribution/vendor)" echo "${1} ${DEPENDENCIES}" | xargs echo -n | tr ' ' ',' diff --git a/vendor/src/github.com/docker/distribution/manifest/manifestlist/manifestlist.go b/vendor/src/github.com/docker/distribution/manifest/manifestlist/manifestlist.go index 49e2b1afd1cf7..a2082ec02f5bd 100644 --- a/vendor/src/github.com/docker/distribution/manifest/manifestlist/manifestlist.go +++ b/vendor/src/github.com/docker/distribution/manifest/manifestlist/manifestlist.go @@ -47,11 +47,19 @@ type PlatformSpec struct { // OS specifies the operating system, for example `linux` or `windows`. OS string `json:"os"` + // OSVersion is an optional field specifying the operating system + // version, for example `10.0.10586`. + OSVersion string `json:"os.version,omitempty"` + + // OSFeatures is an optional field specifying an array of strings, + // each listing a required OS feature (for example on Windows `win32k`). + OSFeatures []string `json:"os.features,omitempty"` + // Variant is an optional field specifying a variant of the CPU, for // example `ppc64le` to specify a little-endian version of a PowerPC CPU. Variant string `json:"variant,omitempty"` - // Features is an optional field specifuing an array of strings, each + // Features is an optional field specifying an array of strings, each // listing a required CPU feature (for example `sse4` or `aes`). Features []string `json:"features,omitempty"` } diff --git a/vendor/src/github.com/docker/distribution/manifest/schema2/builder.go b/vendor/src/github.com/docker/distribution/manifest/schema2/builder.go index 70b006a83703e..44b94eaae9011 100644 --- a/vendor/src/github.com/docker/distribution/manifest/schema2/builder.go +++ b/vendor/src/github.com/docker/distribution/manifest/schema2/builder.go @@ -55,6 +55,9 @@ func (mb *builder) Build(ctx context.Context) (distribution.Manifest, error) { // Add config to the blob store m.Config, err = mb.bs.Put(ctx, MediaTypeConfig, mb.configJSON) + // Override MediaType, since Put always replaces the specified media + // type with application/octet-stream in the descriptor it returns. + m.Config.MediaType = MediaTypeConfig if err != nil { return nil, err } diff --git a/vendor/src/github.com/docker/distribution/registry.go b/vendor/src/github.com/docker/distribution/registry.go index fbe605e0a5a60..1ede31ebb63ce 100644 --- a/vendor/src/github.com/docker/distribution/registry.go +++ b/vendor/src/github.com/docker/distribution/registry.go @@ -58,6 +58,20 @@ type ManifestServiceOption interface { Apply(ManifestService) error } +// WithTag allows a tag to be passed into Put +func WithTag(tag string) ManifestServiceOption { + return WithTagOption{tag} +} + +// WithTagOption holds a tag +type WithTagOption struct{ Tag string } + +// Apply conforms to the ManifestServiceOption interface +func (o WithTagOption) Apply(m ManifestService) error { + // no implementation + return nil +} + // Repository is a named collection of manifests and layers. type Repository interface { // Named returns the name of the repository. diff --git a/vendor/src/github.com/docker/distribution/registry/api/v2/urls.go b/vendor/src/github.com/docker/distribution/registry/api/v2/urls.go index 408c7b74bbdc3..a959aaa89713e 100644 --- a/vendor/src/github.com/docker/distribution/registry/api/v2/urls.go +++ b/vendor/src/github.com/docker/distribution/registry/api/v2/urls.go @@ -17,33 +17,35 @@ import ( // under "/foo/v2/...". Most application will only provide a schema, host and // port, such as "https://localhost:5000/". type URLBuilder struct { - root *url.URL // url root (ie http://localhost/) - router *mux.Router + root *url.URL // url root (ie http://localhost/) + router *mux.Router + relative bool } // NewURLBuilder creates a URLBuilder with provided root url object. -func NewURLBuilder(root *url.URL) *URLBuilder { +func NewURLBuilder(root *url.URL, relative bool) *URLBuilder { return &URLBuilder{ - root: root, - router: Router(), + root: root, + router: Router(), + relative: relative, } } // NewURLBuilderFromString workes identically to NewURLBuilder except it takes // a string argument for the root, returning an error if it is not a valid // url. -func NewURLBuilderFromString(root string) (*URLBuilder, error) { +func NewURLBuilderFromString(root string, relative bool) (*URLBuilder, error) { u, err := url.Parse(root) if err != nil { return nil, err } - return NewURLBuilder(u), nil + return NewURLBuilder(u, relative), nil } // NewURLBuilderFromRequest uses information from an *http.Request to // construct the root url. -func NewURLBuilderFromRequest(r *http.Request) *URLBuilder { +func NewURLBuilderFromRequest(r *http.Request, relative bool) *URLBuilder { var scheme string forwardedProto := r.Header.Get("X-Forwarded-Proto") @@ -85,7 +87,7 @@ func NewURLBuilderFromRequest(r *http.Request) *URLBuilder { u.Path = requestPath[0 : index+1] } - return NewURLBuilder(u) + return NewURLBuilder(u, relative) } // BuildBaseURL constructs a base url for the API, typically just "/v2/". @@ -194,12 +196,13 @@ func (ub *URLBuilder) cloneRoute(name string) clonedRoute { *route = *ub.router.GetRoute(name) // clone the route *root = *ub.root - return clonedRoute{Route: route, root: root} + return clonedRoute{Route: route, root: root, relative: ub.relative} } type clonedRoute struct { *mux.Route - root *url.URL + root *url.URL + relative bool } func (cr clonedRoute) URL(pairs ...string) (*url.URL, error) { @@ -208,6 +211,10 @@ func (cr clonedRoute) URL(pairs ...string) (*url.URL, error) { return nil, err } + if cr.relative { + return routeURL, nil + } + if routeURL.Scheme == "" && routeURL.User == nil && routeURL.Host == "" { routeURL.Path = routeURL.Path[1:] } diff --git a/vendor/src/github.com/docker/distribution/registry/client/repository.go b/vendor/src/github.com/docker/distribution/registry/client/repository.go index 936a3f1b32aa7..8cc5f7f9aa030 100644 --- a/vendor/src/github.com/docker/distribution/registry/client/repository.go +++ b/vendor/src/github.com/docker/distribution/registry/client/repository.go @@ -62,7 +62,7 @@ func checkHTTPRedirect(req *http.Request, via []*http.Request) error { // NewRegistry creates a registry namespace which can be used to get a listing of repositories func NewRegistry(ctx context.Context, baseURL string, transport http.RoundTripper) (Registry, error) { - ub, err := v2.NewURLBuilderFromString(baseURL) + ub, err := v2.NewURLBuilderFromString(baseURL, false) if err != nil { return nil, err } @@ -133,7 +133,7 @@ func (r *registry) Repositories(ctx context.Context, entries []string, last stri // NewRepository creates a new Repository for the given repository name and base URL. func NewRepository(ctx context.Context, name reference.Named, baseURL string, transport http.RoundTripper) (distribution.Repository, error) { - ub, err := v2.NewURLBuilderFromString(baseURL) + ub, err := v2.NewURLBuilderFromString(baseURL, false) if err != nil { return nil, err } @@ -402,9 +402,9 @@ func (ms *manifests) Get(ctx context.Context, dgst digest.Digest, options ...dis ) for _, option := range options { - if opt, ok := option.(withTagOption); ok { - digestOrTag = opt.tag - ref, err = reference.WithTag(ms.name, opt.tag) + if opt, ok := option.(distribution.WithTagOption); ok { + digestOrTag = opt.Tag + ref, err = reference.WithTag(ms.name, opt.Tag) if err != nil { return nil, err } @@ -465,21 +465,6 @@ func (ms *manifests) Get(ctx context.Context, dgst digest.Digest, options ...dis return nil, HandleErrorResponse(resp) } -// WithTag allows a tag to be passed into Put which enables the client -// to build a correct URL. -func WithTag(tag string) distribution.ManifestServiceOption { - return withTagOption{tag} -} - -type withTagOption struct{ tag string } - -func (o withTagOption) Apply(m distribution.ManifestService) error { - if _, ok := m.(*manifests); ok { - return nil - } - return fmt.Errorf("withTagOption is a client-only option") -} - // Put puts a manifest. A tag can be specified using an options parameter which uses some shared state to hold the // tag name in order to build the correct upload URL. func (ms *manifests) Put(ctx context.Context, m distribution.Manifest, options ...distribution.ManifestServiceOption) (digest.Digest, error) { @@ -487,9 +472,9 @@ func (ms *manifests) Put(ctx context.Context, m distribution.Manifest, options . var tagged bool for _, option := range options { - if opt, ok := option.(withTagOption); ok { + if opt, ok := option.(distribution.WithTagOption); ok { var err error - ref, err = reference.WithTag(ref, opt.tag) + ref, err = reference.WithTag(ref, opt.Tag) if err != nil { return "", err } From 41130fb9bc6def57a2b38f54c6514e78aa3f12b9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 14 Apr 2016 15:04:33 +0200 Subject: [PATCH 03/22] docs: update API for features added in 1.11 Docker 1.11 added a feature to set labels on volumes, networks and images (during build), but these changes were not documented in the API documentation. This adds the new features to the documentation. Also fixes some minor formatting, and options that were not used in the examples. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit ba353f37870fdeb8b875a79e1aec54dc3d1aedc4) --- docs/reference/api/docker_remote_api_v1.23.md | 54 +++++++++++++++---- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/docs/reference/api/docker_remote_api_v1.23.md b/docs/reference/api/docker_remote_api_v1.23.md index 8b43f82bb8994..30f556255cbb0 100644 --- a/docs/reference/api/docker_remote_api_v1.23.md +++ b/docs/reference/api/docker_remote_api_v1.23.md @@ -517,8 +517,8 @@ Return low-level information on the container `id` "Tty": false, "User": "", "Volumes": { - "/volumes/data": {} - }, + "/volumes/data": {} + }, "WorkingDir": "", "StopSignal": "SIGTERM" }, @@ -1660,7 +1660,7 @@ Query Parameters: You can provide one or more `t` parameters. - **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the URI specifies a filename, the file's contents are placed into a file - called `Dockerfile`. + called `Dockerfile`. - **q** – Suppress verbose build output. - **nocache** – Do not use the cache when building the image. - **pull** - Attempt to pull the image even if an older image exists locally. @@ -1678,6 +1678,7 @@ Query Parameters: variable expansion in other Dockerfile instructions. This is not meant for passing secret values. [Read more about the buildargs instruction](../../reference/builder.md#arg) - **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. +- **labels** – JSON map of string pairs for labels to set on the image. Request Headers: @@ -2639,7 +2640,7 @@ interactive session with the `exec` command. **Example response**: HTTP/1.1 200 OK - Content-Type: vnd.docker.raw-stream + Content-Type: application/vnd.docker.raw-stream {{ STREAM }} @@ -2774,7 +2775,11 @@ Create a volume Content-Type: application/json { - "Name": "tardis" + "Name": "tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, } **Example response**: @@ -2785,7 +2790,11 @@ Create a volume { "Name": "tardis", "Driver": "local", - "Mountpoint": "/var/lib/docker/volumes/tardis" + "Mountpoint": "/var/lib/docker/volumes/tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + }, } Status Codes: @@ -2799,6 +2808,7 @@ JSON Parameters: - **Driver** - Name of the volume driver to use. Defaults to `local` for the name. - **DriverOpts** - A mapping of driver options and values. These options are passed directly to the driver and are driver specific. +- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value" [,"key2":"value2"]}` ### Inspect a volume @@ -2816,9 +2826,13 @@ Return low-level information on the volume `name` Content-Type: application/json { - "Name": "tardis", - "Driver": "local", - "Mountpoint": "/var/lib/docker/volumes/tardis" + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis/_data", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } } Status Codes: @@ -2989,6 +3003,10 @@ Content-Type: application/json "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" } } ``` @@ -3012,6 +3030,7 @@ Content-Type: application/json { "Name":"isolated_nw", + "CheckDuplicate":false, "Driver":"bridge", "EnableIPv6": true, "IPAM":{ @@ -3030,7 +3049,19 @@ Content-Type: application/json "foo": "bar" } }, - "Internal":true + "Internal":true, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } } ``` @@ -3055,12 +3086,13 @@ Status Codes: JSON Parameters: - **Name** - The new network's name. this is a mandatory field +- **CheckDuplicate** - Requests daemon to check for networks with same name - **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver - **Internal** - Restrict external access to the network - **IPAM** - Optional custom IP scheme for the network - **EnableIPv6** - Enable IPv6 on the network - **Options** - Network specific options to be used by the drivers -- **CheckDuplicate** - Requests daemon to check for networks with same name +- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}` ### Connect a container to a network From 044398a7ad1b27ef89513ec4bfb6b14797b09155 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Fri, 15 Apr 2016 12:06:26 +0800 Subject: [PATCH 04/22] Remove rpc error when shut down daemon RPC connection closing error will be reported every time we shutdown daemon, this error is expected, so we should remove this error to avoid confusion to user. Signed-off-by: Zhang Wei (cherry picked from commit a02ae66d361464cc24bec4fb6aa5778c9d5b8cda) --- libcontainerd/remote_linux.go | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/libcontainerd/remote_linux.go b/libcontainerd/remote_linux.go index 436f43c9d7332..4f907abecac43 100644 --- a/libcontainerd/remote_linux.go +++ b/libcontainerd/remote_linux.go @@ -23,6 +23,7 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/transport" ) const ( @@ -37,17 +38,18 @@ const ( type remote struct { sync.RWMutex - apiClient containerd.APIClient - daemonPid int - stateDir string - rpcAddr string - startDaemon bool - debugLog bool - rpcConn *grpc.ClientConn - clients []*client - eventTsPath string - pastEvents map[string]*containerd.Event - runtimeArgs []string + apiClient containerd.APIClient + daemonPid int + stateDir string + rpcAddr string + startDaemon bool + closeManually bool + debugLog bool + rpcConn *grpc.ClientConn + clients []*client + eventTsPath string + pastEvents map[string]*containerd.Event + runtimeArgs []string } // New creates a fresh instance of libcontainerd remote. @@ -147,6 +149,7 @@ func (r *remote) Cleanup() { if r.daemonPid == -1 { return } + r.closeManually = true r.rpcConn.Close() // Ask the daemon to quit syscall.Kill(r.daemonPid, syscall.SIGTERM) @@ -254,6 +257,11 @@ func (r *remote) handleEventStream(events containerd.API_EventsClient) { for { e, err := events.Recv() if err != nil { + if grpc.ErrorDesc(err) == transport.ErrConnClosing.Desc && + r.closeManually { + // ignore error if grpc remote connection is closed manually + return + } logrus.Errorf("failed to receive event from containerd: %v", err) go r.startEventsMonitor() return From c9417489a2a4877db1a2f7359e7b6c362b5e23b3 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Thu, 14 Apr 2016 21:40:20 -0400 Subject: [PATCH 05/22] Don't throw "restartmanager canceled" error for no restart policy container Don't throw "restartmanager canceled" error for no restart policy container and add the container id to the warning message if a container has restart policy and has been canceled. Signed-off-by: Lei Jitang (cherry picked from commit 494297baf8f391ce73cdc2e885a335a266261970) --- libcontainerd/container_linux.go | 2 +- restartmanager/restartmanager.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libcontainerd/container_linux.go b/libcontainerd/container_linux.go index 6f168ca1da19a..631b225e6886a 100644 --- a/libcontainerd/container_linux.go +++ b/libcontainerd/container_linux.go @@ -117,7 +117,7 @@ func (ctr *container) handleEvent(e *containerd.Event) error { if st.State == StateExit && ctr.restartManager != nil { restart, wait, err := ctr.restartManager.ShouldRestart(e.Status) if err != nil { - logrus.Error(err) + logrus.Warnf("container %s %v", ctr.containerID, err) } else if restart { st.State = StateRestart ctr.restarting = true diff --git a/restartmanager/restartmanager.go b/restartmanager/restartmanager.go index 39b8b1502cfee..2e32950440d0c 100644 --- a/restartmanager/restartmanager.go +++ b/restartmanager/restartmanager.go @@ -42,6 +42,9 @@ func (rm *restartManager) SetPolicy(policy container.RestartPolicy) { } func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, error) { + if rm.policy.IsNone() { + return false, nil, nil + } rm.Lock() unlockOnExit := true defer func() { From ccfb894e6c36f516431c28a435e15005998177be Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 15 Apr 2016 13:28:59 +0200 Subject: [PATCH 06/22] Remove deprecation warning Auto-creation of non-existing host directories is no longer deprecated (9d5c26bed2ac287542e176d9149250927876e3f5), so this warning is no longer relevant. This removes the deprecation warning. Also removes the "system" package here, because it's only used on non-Windows, so basically just called os.MkdirAll() Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 1d02ad2a519765179480e0ae113bcf510a2713af) --- volume/volume.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/volume/volume.go b/volume/volume.go index 1abd1ccb35339..077cddfb9cf6b 100644 --- a/volume/volume.go +++ b/volume/volume.go @@ -5,9 +5,6 @@ import ( "os" "runtime" "strings" - - "github.com/Sirupsen/logrus" - "github.com/docker/docker/pkg/system" ) // DefaultDriverName is the driver name used for the driver @@ -79,8 +76,7 @@ func (m *MountPoint) Setup() (string, error) { return "", err } if runtime.GOOS != "windows" { // Windows does not have deprecation issues here - logrus.Warnf("Auto-creating non-existent volume host path %s, this is deprecated and will be removed soon", m.Source) - if err := system.MkdirAll(m.Source, 0755); err != nil { + if err := os.MkdirAll(m.Source, 0755); err != nil { return "", err } } From 9d684919789d165692a8c5e095c596fef3ad95ba Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 18 Apr 2016 11:12:07 -0700 Subject: [PATCH 07/22] Create a copy of stats value before modifications Fixes #22030 Because the publisher uses this same value to all the stats endpoints we need to make a copy of this as soon as we get it so that we can make our modifications without it affecting others. Signed-off-by: Michael Crosby (cherry picked from commit d17ee4b506af842b2d9fe6f8736b4636e32db599) --- daemon/stats.go | 4 ++-- daemon/stats_collector_unix.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/stats.go b/daemon/stats.go index 1942ccac3cf1a..cb3478ccb9f9f 100644 --- a/daemon/stats.go +++ b/daemon/stats.go @@ -41,11 +41,11 @@ func (daemon *Daemon) ContainerStats(prefixOrName string, config *backend.Contai var preCPUStats types.CPUStats getStatJSON := func(v interface{}) *types.StatsJSON { - ss := v.(*types.StatsJSON) + ss := v.(types.StatsJSON) ss.PreCPUStats = preCPUStats // ss.MemoryStats.Limit = uint64(update.MemoryLimit) preCPUStats = ss.CPUStats - return ss + return &ss } enc := json.NewEncoder(outStream) diff --git a/daemon/stats_collector_unix.go b/daemon/stats_collector_unix.go index fb1931dfb83ae..1f016322df518 100644 --- a/daemon/stats_collector_unix.go +++ b/daemon/stats_collector_unix.go @@ -135,7 +135,7 @@ func (s *statsCollector) run() { // FIXME: move to containerd stats.CPUStats.SystemUsage = systemUsage - pair.publisher.Publish(stats) + pair.publisher.Publish(*stats) } } } From e04dca2bd67f2f25d5616731742ede6b81082c69 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 18 Apr 2016 11:01:02 -0700 Subject: [PATCH 08/22] Clean up exec fifos on process exit Signed-off-by: Tonis Tiigi (cherry picked from commit 84d170129a19855829d282e5416ce08ddb2edbd6) --- libcontainerd/container_linux.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/libcontainerd/container_linux.go b/libcontainerd/container_linux.go index 631b225e6886a..2eea497caf025 100644 --- a/libcontainerd/container_linux.go +++ b/libcontainerd/container_linux.go @@ -36,6 +36,19 @@ func (ctr *container) clean() error { return nil } +// cleanProcess removes the fifos used by an additional process. +// Caller needs to lock container ID before calling this method. +func (ctr *container) cleanProcess(id string) { + if p, ok := ctr.processes[id]; ok { + for _, i := range []int{syscall.Stdin, syscall.Stdout, syscall.Stderr} { + if err := os.Remove(p.fifo(i)); err != nil { + logrus.Warnf("failed to remove %v for process %v: %v", p.fifo(i), id, err) + } + } + } + delete(ctr.processes, id) +} + func (ctr *container) spec() (*specs.Spec, error) { var spec specs.Spec dt, err := ioutil.ReadFile(filepath.Join(ctr.dir, configFilename)) @@ -142,11 +155,14 @@ func (ctr *container) handleEvent(e *containerd.Event) error { // Remove process from list if we have exited // We need to do so here in case the Message Handler decides to restart it. - if st.State == StateExit { + switch st.State { + case StateExit: if os.Getenv("LIBCONTAINERD_NOCLEAN") != "1" { ctr.clean() } ctr.client.deleteContainer(e.Id) + case StateExitProcess: + ctr.cleanProcess(st.ProcessID) } ctr.client.q.append(e.Id, func() { if err := ctr.client.backend.StateChanged(e.Id, st); err != nil { From 8c1d8025f2ecf4751787bc9666898ef464322296 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 18 Apr 2016 11:48:28 -0700 Subject: [PATCH 09/22] Remove restart canceled error It should not be an error to call a common option to cancel restarts. Signed-off-by: Michael Crosby (cherry picked from commit fc2e2234c614379d21c16e32c1b82e7819fc3eac) --- libcontainerd/container_linux.go | 5 ++++- restartmanager/restartmanager.go | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libcontainerd/container_linux.go b/libcontainerd/container_linux.go index 2eea497caf025..b5f13ef150dde 100644 --- a/libcontainerd/container_linux.go +++ b/libcontainerd/container_linux.go @@ -9,6 +9,7 @@ import ( "github.com/Sirupsen/logrus" containerd "github.com/docker/containerd/api/grpc/types" + "github.com/docker/docker/restartmanager" "github.com/opencontainers/specs/specs-go" "golang.org/x/net/context" ) @@ -145,7 +146,9 @@ func (ctr *container) handleEvent(e *containerd.Event) error { logrus.Error(err) } }) - logrus.Error(err) + if err != restartmanager.ErrRestartCanceled { + logrus.Error(err) + } } else { ctr.start() } diff --git a/restartmanager/restartmanager.go b/restartmanager/restartmanager.go index 2e32950440d0c..41f44098c0487 100644 --- a/restartmanager/restartmanager.go +++ b/restartmanager/restartmanager.go @@ -1,6 +1,7 @@ package restartmanager import ( + "errors" "fmt" "sync" "time" @@ -13,6 +14,10 @@ const ( defaultTimeout = 100 * time.Millisecond ) +// ErrRestartCanceled is returned when the restart manager has been +// canceled and will no longer restart the container. +var ErrRestartCanceled = errors.New("restart canceled") + // RestartManager defines object that controls container restarting rules. type RestartManager interface { Cancel() error @@ -54,7 +59,7 @@ func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, erro }() if rm.canceled { - return false, nil, fmt.Errorf("restartmanager canceled") + return false, nil, ErrRestartCanceled } if rm.active { @@ -97,7 +102,7 @@ func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, erro go func() { select { case <-rm.cancel: - ch <- fmt.Errorf("restartmanager canceled") + ch <- ErrRestartCanceled close(ch) case <-time.After(rm.timeout): rm.Lock() From c3348d02d5619e9c9231761a4c1f98f6f6ac291a Mon Sep 17 00:00:00 2001 From: Madhu Venugopal Date: Wed, 20 Apr 2016 05:38:34 -0700 Subject: [PATCH 10/22] Initialize activateWait for plugins activated by json spec Signed-off-by: Madhu Venugopal (cherry picked from commit de806a672b0810e48facc74e198e6728c1fe2c6d) --- ...cker_cli_external_graphdriver_unix_test.go | 106 +++++++++++------- pkg/plugins/discovery.go | 2 + 2 files changed, 70 insertions(+), 38 deletions(-) diff --git a/integration-cli/docker_cli_external_graphdriver_unix_test.go b/integration-cli/docker_cli_external_graphdriver_unix_test.go index 9fd36ec9c114f..33fe4058fc8f1 100644 --- a/integration-cli/docker_cli_external_graphdriver_unix_test.go +++ b/integration-cli/docker_cli_external_graphdriver_unix_test.go @@ -16,6 +16,7 @@ import ( "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/daemon/graphdriver/vfs" "github.com/docker/docker/pkg/archive" + "github.com/docker/docker/pkg/plugins" "github.com/go-check/check" ) @@ -26,10 +27,11 @@ func init() { } type DockerExternalGraphdriverSuite struct { - server *httptest.Server - ds *DockerSuite - d *Daemon - ec *graphEventsCounter + server *httptest.Server + jserver *httptest.Server + ds *DockerSuite + d *Daemon + ec map[string]*graphEventsCounter } type graphEventsCounter struct { @@ -51,7 +53,6 @@ type graphEventsCounter struct { func (s *DockerExternalGraphdriverSuite) SetUpTest(c *check.C) { s.d = NewDaemon(c) - s.ec = &graphEventsCounter{} } func (s *DockerExternalGraphdriverSuite) TearDownTest(c *check.C) { @@ -60,9 +61,30 @@ func (s *DockerExternalGraphdriverSuite) TearDownTest(c *check.C) { } func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { + s.ec = make(map[string]*graphEventsCounter) + s.setUpPluginViaSpecFile(c) + s.setUpPluginViaJSONFile(c) +} + +func (s *DockerExternalGraphdriverSuite) setUpPluginViaSpecFile(c *check.C) { mux := http.NewServeMux() s.server = httptest.NewServer(mux) + s.setUpPlugin(c, "test-external-graph-driver", "spec", mux, []byte(s.server.URL)) +} + +func (s *DockerExternalGraphdriverSuite) setUpPluginViaJSONFile(c *check.C) { + mux := http.NewServeMux() + s.jserver = httptest.NewServer(mux) + + p := plugins.Plugin{Name: "json-external-graph-driver", Addr: s.jserver.URL} + b, err := json.Marshal(p) + c.Assert(err, check.IsNil) + + s.setUpPlugin(c, "json-external-graph-driver", "json", mux, b) +} + +func (s *DockerExternalGraphdriverSuite) setUpPlugin(c *check.C, name string, ext string, mux *http.ServeMux, b []byte) { type graphDriverRequest struct { ID string `json:",omitempty"` Parent string `json:",omitempty"` @@ -99,24 +121,25 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { return nil } - base, err := ioutil.TempDir("", "external-graph-test") + base, err := ioutil.TempDir("", name) c.Assert(err, check.IsNil) vfsProto, err := vfs.Init(base, []string{}, nil, nil) c.Assert(err, check.IsNil, check.Commentf("error initializing graph driver")) driver := graphdriver.NewNaiveDiffDriver(vfsProto, nil, nil) + s.ec[ext] = &graphEventsCounter{} mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) { - s.ec.activations++ + s.ec[ext].activations++ respond(w, `{"Implements": ["GraphDriver"]}`) }) mux.HandleFunc("/GraphDriver.Init", func(w http.ResponseWriter, r *http.Request) { - s.ec.init++ + s.ec[ext].init++ respond(w, "{}") }) mux.HandleFunc("/GraphDriver.Create", func(w http.ResponseWriter, r *http.Request) { - s.ec.creations++ + s.ec[ext].creations++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -130,7 +153,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.Remove", func(w http.ResponseWriter, r *http.Request) { - s.ec.removals++ + s.ec[ext].removals++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -145,7 +168,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.Get", func(w http.ResponseWriter, r *http.Request) { - s.ec.gets++ + s.ec[ext].gets++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -161,7 +184,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.Put", func(w http.ResponseWriter, r *http.Request) { - s.ec.puts++ + s.ec[ext].puts++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -176,7 +199,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.Exists", func(w http.ResponseWriter, r *http.Request) { - s.ec.exists++ + s.ec[ext].exists++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -186,12 +209,12 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.Status", func(w http.ResponseWriter, r *http.Request) { - s.ec.stats++ + s.ec[ext].stats++ respond(w, &graphDriverResponse{Status: driver.Status()}) }) mux.HandleFunc("/GraphDriver.Cleanup", func(w http.ResponseWriter, r *http.Request) { - s.ec.cleanups++ + s.ec[ext].cleanups++ err := driver.Cleanup() if err != nil { respond(w, err) @@ -201,7 +224,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.GetMetadata", func(w http.ResponseWriter, r *http.Request) { - s.ec.metadata++ + s.ec[ext].metadata++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -217,7 +240,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.Diff", func(w http.ResponseWriter, r *http.Request) { - s.ec.diff++ + s.ec[ext].diff++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -233,7 +256,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.Changes", func(w http.ResponseWriter, r *http.Request) { - s.ec.changes++ + s.ec[ext].changes++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { return @@ -248,7 +271,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.ApplyDiff", func(w http.ResponseWriter, r *http.Request) { - s.ec.applydiff++ + s.ec[ext].applydiff++ var diff archive.Reader = r.Body defer r.Body.Close() @@ -268,7 +291,7 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { }) mux.HandleFunc("/GraphDriver.DiffSize", func(w http.ResponseWriter, r *http.Request) { - s.ec.diffsize++ + s.ec[ext].diffsize++ var req graphDriverRequest if err := decReq(r.Body, &req, w); err != nil { @@ -286,19 +309,26 @@ func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) { err = os.MkdirAll("/etc/docker/plugins", 0755) c.Assert(err, check.IsNil, check.Commentf("error creating /etc/docker/plugins")) - err = ioutil.WriteFile("/etc/docker/plugins/test-external-graph-driver.spec", []byte(s.server.URL), 0644) - c.Assert(err, check.IsNil, check.Commentf("error writing to /etc/docker/plugins/test-external-graph-driver.spec")) + specFile := "/etc/docker/plugins/" + name + "." + ext + err = ioutil.WriteFile(specFile, b, 0644) + c.Assert(err, check.IsNil, check.Commentf("error writing to %s", specFile)) } func (s *DockerExternalGraphdriverSuite) TearDownSuite(c *check.C) { s.server.Close() + s.jserver.Close() err := os.RemoveAll("/etc/docker/plugins") c.Assert(err, check.IsNil, check.Commentf("error removing /etc/docker/plugins")) } func (s *DockerExternalGraphdriverSuite) TestExternalGraphDriver(c *check.C) { - if err := s.d.StartWithBusybox("-s", "test-external-graph-driver"); err != nil { + s.testExternalGraphDriver("test-external-graph-driver", "spec", c) + s.testExternalGraphDriver("json-external-graph-driver", "json", c) +} + +func (s *DockerExternalGraphdriverSuite) testExternalGraphDriver(name string, ext string, c *check.C) { + if err := s.d.StartWithBusybox("-s", name); err != nil { b, _ := ioutil.ReadFile(s.d.LogFileName()) c.Assert(err, check.IsNil, check.Commentf("\n%s", string(b))) } @@ -306,11 +336,11 @@ func (s *DockerExternalGraphdriverSuite) TestExternalGraphDriver(c *check.C) { out, err := s.d.Cmd("run", "-d", "--name=graphtest", "busybox", "sh", "-c", "echo hello > /hello") c.Assert(err, check.IsNil, check.Commentf(out)) - err = s.d.Restart("-s", "test-external-graph-driver") + err = s.d.Restart("-s", name) out, err = s.d.Cmd("inspect", "--format='{{.GraphDriver.Name}}'", "graphtest") c.Assert(err, check.IsNil, check.Commentf(out)) - c.Assert(strings.TrimSpace(out), check.Equals, "test-external-graph-driver") + c.Assert(strings.TrimSpace(out), check.Equals, name) out, err = s.d.Cmd("diff", "graphtest") c.Assert(err, check.IsNil, check.Commentf(out)) @@ -327,19 +357,19 @@ func (s *DockerExternalGraphdriverSuite) TestExternalGraphDriver(c *check.C) { // Don't check s.ec.exists, because the daemon no longer calls the // Exists function. - c.Assert(s.ec.activations, check.Equals, 2) - c.Assert(s.ec.init, check.Equals, 2) - c.Assert(s.ec.creations >= 1, check.Equals, true) - c.Assert(s.ec.removals >= 1, check.Equals, true) - c.Assert(s.ec.gets >= 1, check.Equals, true) - c.Assert(s.ec.puts >= 1, check.Equals, true) - c.Assert(s.ec.stats, check.Equals, 3) - c.Assert(s.ec.cleanups, check.Equals, 2) - c.Assert(s.ec.applydiff >= 1, check.Equals, true) - c.Assert(s.ec.changes, check.Equals, 1) - c.Assert(s.ec.diffsize, check.Equals, 0) - c.Assert(s.ec.diff, check.Equals, 0) - c.Assert(s.ec.metadata, check.Equals, 1) + c.Assert(s.ec[ext].activations, check.Equals, 2) + c.Assert(s.ec[ext].init, check.Equals, 2) + c.Assert(s.ec[ext].creations >= 1, check.Equals, true) + c.Assert(s.ec[ext].removals >= 1, check.Equals, true) + c.Assert(s.ec[ext].gets >= 1, check.Equals, true) + c.Assert(s.ec[ext].puts >= 1, check.Equals, true) + c.Assert(s.ec[ext].stats, check.Equals, 3) + c.Assert(s.ec[ext].cleanups, check.Equals, 2) + c.Assert(s.ec[ext].applydiff >= 1, check.Equals, true) + c.Assert(s.ec[ext].changes, check.Equals, 1) + c.Assert(s.ec[ext].diffsize, check.Equals, 0) + c.Assert(s.ec[ext].diff, check.Equals, 0) + c.Assert(s.ec[ext].metadata, check.Equals, 1) } func (s *DockerExternalGraphdriverSuite) TestExternalGraphDriverPull(c *check.C) { diff --git a/pkg/plugins/discovery.go b/pkg/plugins/discovery.go index 3f7966178257e..9dc64194f2b11 100644 --- a/pkg/plugins/discovery.go +++ b/pkg/plugins/discovery.go @@ -9,6 +9,7 @@ import ( "os" "path/filepath" "strings" + "sync" ) var ( @@ -118,6 +119,7 @@ func readPluginJSONInfo(name, path string) (*Plugin, error) { if len(p.TLSConfig.CAFile) == 0 { p.TLSConfig.InsecureSkipVerify = true } + p.activateWait = sync.NewCond(&sync.Mutex{}) return &p, nil } From ce9e2d800a1c3789276b999bc9257b2a4ec317d8 Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Tue, 19 Apr 2016 17:16:18 -0400 Subject: [PATCH 11/22] Containerize `TestDaemonNoSpaceLeftOnDeviceError` Why? Because the `mount` here will sometimes fail when run in `debian:jessie`, which is what the environrment hosting the test suite is running if run from the `Makefile`. Also, why the heck not containerize it, all the things. Signed-off-by: Brian Goff (cherry picked from commit 59b83d8aae106cdc4042c29c900069fc804b2b68) --- integration-cli/docker_cli_daemon_test.go | 36 +++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 661fbc4ca5b97..348653bf45e2d 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -21,6 +21,7 @@ import ( "time" "github.com/docker/docker/pkg/integration/checker" + "github.com/docker/docker/pkg/mount" "github.com/docker/go-units" "github.com/docker/libnetwork/iptables" "github.com/docker/libtrust" @@ -1849,31 +1850,28 @@ func (s *DockerDaemonSuite) TestBridgeIPIsExcludedFromAllocatorPool(c *check.C) } // Test daemon for no space left on device error -func (s *DockerDaemonSuite) TestDaemonNoSpaceleftOnDeviceError(c *check.C) { +func (s *DockerDaemonSuite) TestDaemonNoSpaceLeftOnDeviceError(c *check.C) { testRequires(c, SameHostDaemon, DaemonIsLinux, Network) + testDir, err := ioutil.TempDir("", "no-space-left-on-device-test") + c.Assert(err, checker.IsNil) + defer os.RemoveAll(testDir) + c.Assert(mount.MakeRShared(testDir), checker.IsNil) + defer mount.Unmount(testDir) + defer mount.Unmount(filepath.Join(testDir, "test-mount")) + // create a 2MiB image and mount it as graph root - cmd := exec.Command("dd", "of=/tmp/testfs.img", "bs=1M", "seek=2", "count=0") - if err := cmd.Run(); err != nil { - c.Fatalf("dd failed: %v", err) - } - cmd = exec.Command("mkfs.ext4", "-F", "/tmp/testfs.img") - if err := cmd.Run(); err != nil { - c.Fatalf("mkfs.ext4 failed: %v", err) - } - cmd = exec.Command("mkdir", "-p", "/tmp/testfs-mount") - if err := cmd.Run(); err != nil { - c.Fatalf("mkdir failed: %v", err) - } - cmd = exec.Command("mount", "-t", "ext4", "-no", "loop,rw", "/tmp/testfs.img", "/tmp/testfs-mount") - if err := cmd.Run(); err != nil { - c.Fatalf("mount failed: %v", err) - } - err := s.d.Start("--graph", "/tmp/testfs-mount") + // Why in a container? Because `mount` sometimes behaves weirdly and often fails outright on this test in debian:jessie (which is what the test suite runs under if run from the Makefile) + dockerCmd(c, "run", "--rm", "-v", testDir+":/test", "busybox", "sh", "-c", "dd of=/test/testfs.img bs=1M seek=2 count=0") + out, _, err := runCommandWithOutput(exec.Command("mkfs.ext4", "-F", filepath.Join(testDir, "testfs.img"))) // `mkfs.ext4` is not in busybox + c.Assert(err, checker.IsNil, check.Commentf(out)) + dockerCmd(c, "run", "--privileged", "--rm", "-v", testDir+":/test:shared", "busybox", "sh", "-c", "mkdir -p /test/test-mount && mount -t ext4 -no loop,rw /test/testfs.img /test/test-mount") + + err = s.d.Start("--graph", filepath.Join(testDir, "test-mount")) c.Assert(err, check.IsNil) // pull a repository large enough to fill the mount point - out, err := s.d.Cmd("pull", "registry:2") + out, err = s.d.Cmd("pull", "registry:2") c.Assert(out, checker.Contains, "no space left on device") } From 45730a45841f96b1b7b96e79524d4333ffbd0896 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Wed, 20 Apr 2016 18:33:53 -0700 Subject: [PATCH 12/22] Docker http panics caused by container deletion with empty names. This fix tries to fix the http panics caused by container deletion with empty names in #22210. The issue was because when an empty string was passed, `GetByName()` tried to access the first element of the name string without checking the length. A length check has been added. A test case for #22210 has been added. This fix fixes #22210. Signed-off-by: Yong Tang (cherry picked from commit 9d8071a74db20556d0fc1b6ef3270326b3583de9) --- daemon/daemon.go | 7 +++++++ integration-cli/docker_api_containers_test.go | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/daemon/daemon.go b/daemon/daemon.go index ee68a3c45dd3c..43b3e48ef40bb 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -140,6 +140,10 @@ type Daemon struct { // unique enough to only return a single container object // If none of these searches succeed, an error is returned func (daemon *Daemon) GetContainer(prefixOrName string) (*container.Container, error) { + if len(prefixOrName) == 0 { + return nil, errors.NewBadRequestError(fmt.Errorf("No container name or ID supplied")) + } + if containerByID := daemon.containers.Get(prefixOrName); containerByID != nil { // prefix is an exact match to a full container ID return containerByID, nil @@ -532,6 +536,9 @@ func (daemon *Daemon) newContainer(name string, config *containertypes.Config, i // GetByName returns a container given a name. func (daemon *Daemon) GetByName(name string) (*container.Container, error) { + if len(name) == 0 { + return nil, fmt.Errorf("No container name supplied") + } fullName := name if name[0] != '/' { fullName = "/" + name diff --git a/integration-cli/docker_api_containers_test.go b/integration-cli/docker_api_containers_test.go index eb671459f26b5..2622a54449f17 100644 --- a/integration-cli/docker_api_containers_test.go +++ b/integration-cli/docker_api_containers_test.go @@ -1616,3 +1616,11 @@ func (s *DockerSuite) TestPostContainersCreateWithOomScoreAdjInvalidRange(c *che c.Fatalf("Expected output to contain %q, got %q", expected, string(b)) } } + +// test case for #22210 where an emtpy container name caused panic. +func (s *DockerSuite) TestContainerApiDeleteWithEmptyName(c *check.C) { + status, out, err := sockRequest("DELETE", "/containers/", nil) + c.Assert(err, checker.IsNil) + c.Assert(status, checker.Equals, http.StatusBadRequest) + c.Assert(string(out), checker.Contains, "No container name or ID supplied") +} From 2735744cb580a12110401ebb1d6335df15c5d4bb Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 13 Apr 2016 17:55:50 -0700 Subject: [PATCH 13/22] add pkcs11 build tag to deb and rpm builds Signed-off-by: David Lawrence (github: endophage) (cherry picked from commit 829d1883dccc8000a6781bc074fd16afe2833841) Signed-off-by: Kenfe-Mickael Laventure --- contrib/builder/deb/amd64/debian-jessie/Dockerfile | 2 +- contrib/builder/deb/amd64/debian-stretch/Dockerfile | 2 +- contrib/builder/deb/amd64/debian-wheezy/Dockerfile | 2 +- contrib/builder/deb/amd64/generate.sh | 2 +- contrib/builder/deb/amd64/ubuntu-precise/Dockerfile | 2 +- contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile | 2 +- contrib/builder/deb/amd64/ubuntu-wily/Dockerfile | 2 +- contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile | 2 +- contrib/builder/rpm/amd64/centos-7/Dockerfile | 2 +- contrib/builder/rpm/amd64/fedora-22/Dockerfile | 2 +- contrib/builder/rpm/amd64/fedora-23/Dockerfile | 2 +- contrib/builder/rpm/amd64/generate.sh | 2 +- contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile | 2 +- contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile | 2 +- contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/builder/deb/amd64/debian-jessie/Dockerfile b/contrib/builder/deb/amd64/debian-jessie/Dockerfile index 6494f89ab569d..43e2cb08bc6a7 100644 --- a/contrib/builder/deb/amd64/debian-jessie/Dockerfile +++ b/contrib/builder/deb/amd64/debian-jessie/Dockerfile @@ -12,5 +12,5 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS apparmor selinux +ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/debian-stretch/Dockerfile b/contrib/builder/deb/amd64/debian-stretch/Dockerfile index 257f9d4135616..5bba0ae08b36d 100644 --- a/contrib/builder/deb/amd64/debian-stretch/Dockerfile +++ b/contrib/builder/deb/amd64/debian-stretch/Dockerfile @@ -12,5 +12,5 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS apparmor seccomp selinux +ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux ENV RUNC_BUILDTAGS apparmor seccomp selinux diff --git a/contrib/builder/deb/amd64/debian-wheezy/Dockerfile b/contrib/builder/deb/amd64/debian-wheezy/Dockerfile index 30530111f61b4..3568c69d2d437 100644 --- a/contrib/builder/deb/amd64/debian-wheezy/Dockerfile +++ b/contrib/builder/deb/amd64/debian-wheezy/Dockerfile @@ -13,5 +13,5 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS apparmor selinux +ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/generate.sh b/contrib/builder/deb/amd64/generate.sh index 86dfab0d2cbb7..fe9ff224a2589 100755 --- a/contrib/builder/deb/amd64/generate.sh +++ b/contrib/builder/deb/amd64/generate.sh @@ -41,7 +41,7 @@ for version in "${versions[@]}"; do echo >> "$version/Dockerfile" - extraBuildTags= + extraBuildTags='pkcs11' runcBuildTags= # this list is sorted alphabetically; please keep it that way diff --git a/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile b/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile index f58041eb23122..d88301ede7ed8 100644 --- a/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile +++ b/contrib/builder/deb/amd64/ubuntu-precise/Dockerfile @@ -12,5 +12,5 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS apparmor exclude_graphdriver_btrfs exclude_graphdriver_devicemapper selinux +ENV DOCKER_BUILDTAGS apparmor exclude_graphdriver_btrfs exclude_graphdriver_devicemapper pkcs11 selinux ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile b/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile index 5a8354dba879e..1e83056f3236c 100644 --- a/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile +++ b/contrib/builder/deb/amd64/ubuntu-trusty/Dockerfile @@ -12,5 +12,5 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS apparmor selinux +ENV DOCKER_BUILDTAGS apparmor pkcs11 selinux ENV RUNC_BUILDTAGS apparmor selinux diff --git a/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile b/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile index 3b45e6b9a7a6a..acf268f7a4459 100644 --- a/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile +++ b/contrib/builder/deb/amd64/ubuntu-wily/Dockerfile @@ -12,5 +12,5 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS apparmor seccomp selinux +ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux ENV RUNC_BUILDTAGS apparmor seccomp selinux diff --git a/contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile b/contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile index 888a24822f895..1a4cc8e482ad9 100644 --- a/contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile +++ b/contrib/builder/deb/amd64/ubuntu-xenial/Dockerfile @@ -12,5 +12,5 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS apparmor seccomp selinux +ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux ENV RUNC_BUILDTAGS apparmor seccomp selinux diff --git a/contrib/builder/rpm/amd64/centos-7/Dockerfile b/contrib/builder/rpm/amd64/centos-7/Dockerfile index 1adddc16845dd..25d09df9a8f3b 100644 --- a/contrib/builder/rpm/amd64/centos-7/Dockerfile +++ b/contrib/builder/rpm/amd64/centos-7/Dockerfile @@ -14,6 +14,6 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS selinux +ENV DOCKER_BUILDTAGS pkcs11 selinux ENV RUNC_BUILDTAGS selinux diff --git a/contrib/builder/rpm/amd64/fedora-22/Dockerfile b/contrib/builder/rpm/amd64/fedora-22/Dockerfile index 835f8db5b7a01..4013803879b1c 100644 --- a/contrib/builder/rpm/amd64/fedora-22/Dockerfile +++ b/contrib/builder/rpm/amd64/fedora-22/Dockerfile @@ -13,6 +13,6 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS seccomp selinux +ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux ENV RUNC_BUILDTAGS seccomp selinux diff --git a/contrib/builder/rpm/amd64/fedora-23/Dockerfile b/contrib/builder/rpm/amd64/fedora-23/Dockerfile index 62b6bccd67fd4..5d311a008c327 100644 --- a/contrib/builder/rpm/amd64/fedora-23/Dockerfile +++ b/contrib/builder/rpm/amd64/fedora-23/Dockerfile @@ -13,6 +13,6 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS seccomp selinux +ENV DOCKER_BUILDTAGS pkcs11 seccomp selinux ENV RUNC_BUILDTAGS seccomp selinux diff --git a/contrib/builder/rpm/amd64/generate.sh b/contrib/builder/rpm/amd64/generate.sh index 05a7797c0d9a3..a8f9c35f3f9e5 100755 --- a/contrib/builder/rpm/amd64/generate.sh +++ b/contrib/builder/rpm/amd64/generate.sh @@ -38,7 +38,7 @@ for version in "${versions[@]}"; do echo >> "$version/Dockerfile" - extraBuildTags= + extraBuildTags='pkcs11' runcBuildTags= case "$from" in diff --git a/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile b/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile index 67f5c44b26429..348e260724780 100644 --- a/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile +++ b/contrib/builder/rpm/amd64/opensuse-13.2/Dockerfile @@ -13,6 +13,6 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS selinux +ENV DOCKER_BUILDTAGS pkcs11 selinux ENV RUNC_BUILDTAGS selinux diff --git a/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile b/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile index defcbf6dd1cf3..a8f9c15e9b136 100644 --- a/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile +++ b/contrib/builder/rpm/amd64/oraclelinux-6/Dockerfile @@ -16,7 +16,7 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS selinux +ENV DOCKER_BUILDTAGS pkcs11 selinux ENV RUNC_BUILDTAGS selinux ENV CGO_CPPFLAGS -D__EXPORTED_HEADERS__ \ diff --git a/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile b/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile index e92086a4060a0..30572e4348dad 100644 --- a/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile +++ b/contrib/builder/rpm/amd64/oraclelinux-7/Dockerfile @@ -13,6 +13,6 @@ ENV PATH $PATH:/usr/local/go/bin ENV AUTO_GOPATH 1 -ENV DOCKER_BUILDTAGS selinux +ENV DOCKER_BUILDTAGS pkcs11 selinux ENV RUNC_BUILDTAGS selinux From 75d6341d561ca7b4f49cb2a8d54f002cfcd406ac Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 21 Apr 2016 13:58:21 -0700 Subject: [PATCH 14/22] Fix config cleanup on canceling restartmanager Signed-off-by: Tonis Tiigi (cherry picked from commit 7bf07737b90f087271b5a9a3a1c8d262c154554f) --- libcontainerd/container_linux.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libcontainerd/container_linux.go b/libcontainerd/container_linux.go index b5f13ef150dde..561e55db11dd8 100644 --- a/libcontainerd/container_linux.go +++ b/libcontainerd/container_linux.go @@ -23,6 +23,9 @@ type container struct { } func (ctr *container) clean() error { + if os.Getenv("LIBCONTAINERD_NOCLEAN") == "1" { + return nil + } if _, err := os.Lstat(ctr.dir); err != nil { if os.IsNotExist(err) { return nil @@ -138,9 +141,12 @@ func (ctr *container) handleEvent(e *containerd.Event) error { ctr.client.deleteContainer(e.Id) go func() { err := <-wait + ctr.client.lock(ctr.containerID) + defer ctr.client.unlock(ctr.containerID) ctr.restarting = false if err != nil { st.State = StateExit + ctr.clean() ctr.client.q.append(e.Id, func() { if err := ctr.client.backend.StateChanged(e.Id, st); err != nil { logrus.Error(err) @@ -160,9 +166,7 @@ func (ctr *container) handleEvent(e *containerd.Event) error { // We need to do so here in case the Message Handler decides to restart it. switch st.State { case StateExit: - if os.Getenv("LIBCONTAINERD_NOCLEAN") != "1" { - ctr.clean() - } + ctr.clean() ctr.client.deleteContainer(e.Id) case StateExitProcess: ctr.cleanProcess(st.ProcessID) From 91880b45a77b4474145dc3c1ff489366d61f6830 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Fri, 22 Apr 2016 16:54:32 +0200 Subject: [PATCH 15/22] api: server: check for unauthorized error This functionality has been fixed by 7bca93218291767c5dd8782de0ad630dbcda9995 but then it has been broken again by a793564b2591035aec5412fbcbcccf220c773a4c and finally refixed here. Basically the functionality was to prompt for login when trying to pull from the official docker hub. Signed-off-by: Antonio Murdaca (cherry picked from commit 4316ae2ed33d158e1d8d994646a75e25a70d9320) --- api/server/httputils/errors.go | 1 + api/server/router/image/image_routes.go | 21 --------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/api/server/httputils/errors.go b/api/server/httputils/errors.go index c6b0a6b2d8c98..cf8d2ae63999b 100644 --- a/api/server/httputils/errors.go +++ b/api/server/httputils/errors.go @@ -52,6 +52,7 @@ func WriteError(w http.ResponseWriter, err error) { "conflict": http.StatusConflict, "impossible": http.StatusNotAcceptable, "wrong login/password": http.StatusUnauthorized, + "unauthorized": http.StatusUnauthorized, "hasn't been activated": http.StatusForbidden, } { if strings.Contains(errStr, keyword) { diff --git a/api/server/router/image/image_routes.go b/api/server/router/image/image_routes.go index 0ead075df876c..58abd4b45776a 100644 --- a/api/server/router/image/image_routes.go +++ b/api/server/router/image/image_routes.go @@ -7,11 +7,9 @@ import ( "fmt" "io" "net/http" - "net/url" "strings" "github.com/docker/distribution/digest" - "github.com/docker/distribution/registry/api/errcode" "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/builder/dockerfile" "github.com/docker/docker/pkg/ioutils" @@ -132,12 +130,6 @@ func (s *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWrite err = s.backend.PullImage(ctx, ref, metaHeaders, authConfig, output) } } - // Check the error from pulling an image to make sure the request - // was authorized. Modify the status if the request was - // unauthorized to respond with 401 rather than 500. - if err != nil && isAuthorizedError(err) { - err = errcode.ErrorCodeUnauthorized.WithMessage(fmt.Sprintf("Authentication is required: %s", err)) - } } else { //import var newRef reference.Named if repo != "" { @@ -389,16 +381,3 @@ func (s *imageRouter) getImagesSearch(ctx context.Context, w http.ResponseWriter } return httputils.WriteJSON(w, http.StatusOK, query.Results) } - -func isAuthorizedError(err error) bool { - if urlError, ok := err.(*url.Error); ok { - err = urlError.Err - } - - if dError, ok := err.(errcode.Error); ok { - if dError.ErrorCode() == errcode.ErrorCodeUnauthorized { - return true - } - } - return false -} From f5034947698227e6d5f618ebe57ccf0b933f30ba Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 22 Apr 2016 09:30:57 -0700 Subject: [PATCH 16/22] Bump containerd to v0.2.1 Signed-off-by: Michael Crosby (cherry picked from commit 199472c75a8e0c60108399de2da0247af1a0bdab) --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- Dockerfile.gccgo | 2 +- Dockerfile.ppc64le | 2 +- Dockerfile.s390x | 2 +- Dockerfile.simple | 2 +- hack/vendor.sh | 2 +- .../containerd/api/grpc/types/api.pb.go | 327 ++++++++++-------- .../containerd/api/grpc/types/api.proto | 1 + 10 files changed, 186 insertions(+), 158 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5a06467ac3716..65ff87f7f65a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -258,7 +258,7 @@ RUN set -x \ && cp runc /usr/local/bin/docker-runc # Install containerd -ENV CONTAINERD_COMMIT d2f03861c91edaafdcb3961461bf82ae83785ed7 +ENV CONTAINERD_COMMIT v0.2.1 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index be9c0f8f0c33a..b26424d6c8e30 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -191,7 +191,7 @@ RUN set -x \ && cp runc /usr/local/bin/docker-runc # Install containerd -ENV CONTAINERD_COMMIT d2f03861c91edaafdcb3961461bf82ae83785ed7 +ENV CONTAINERD_COMMIT v0.2.1 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 1af5abdf53575..739f5db10b9eb 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -210,7 +210,7 @@ RUN set -x \ && cp runc /usr/local/bin/docker-runc # Install containerd -ENV CONTAINERD_COMMIT d2f03861c91edaafdcb3961461bf82ae83785ed7 +ENV CONTAINERD_COMMIT v0.2.1 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \ diff --git a/Dockerfile.gccgo b/Dockerfile.gccgo index 1fb0db211f749..30500e3eccaf3 100644 --- a/Dockerfile.gccgo +++ b/Dockerfile.gccgo @@ -84,7 +84,7 @@ RUN set -x \ && cp runc /usr/local/bin/docker-runc # Install containerd -ENV CONTAINERD_COMMIT d2f03861c91edaafdcb3961461bf82ae83785ed7 +ENV CONTAINERD_COMMIT v0.2.1 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \ diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le index be64af8db0031..dc559c902739a 100644 --- a/Dockerfile.ppc64le +++ b/Dockerfile.ppc64le @@ -209,7 +209,7 @@ RUN set -x \ && cp runc /usr/local/bin/docker-runc # Install containerd -ENV CONTAINERD_COMMIT d2f03861c91edaafdcb3961461bf82ae83785ed7 +ENV CONTAINERD_COMMIT v0.2.1 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \ diff --git a/Dockerfile.s390x b/Dockerfile.s390x index b758209c3ba8c..929ce92e61854 100644 --- a/Dockerfile.s390x +++ b/Dockerfile.s390x @@ -188,7 +188,7 @@ RUN set -x \ && cp runc /usr/local/bin/docker-runc # Install containerd -ENV CONTAINERD_COMMIT d2f03861c91edaafdcb3961461bf82ae83785ed7 +ENV CONTAINERD_COMMIT v0.2.1 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \ diff --git a/Dockerfile.simple b/Dockerfile.simple index 775584be49211..2113af6cdd273 100644 --- a/Dockerfile.simple +++ b/Dockerfile.simple @@ -40,7 +40,7 @@ RUN set -x \ && cp runc /usr/local/bin/docker-runc # Install containerd -ENV CONTAINERD_COMMIT d2f03861c91edaafdcb3961461bf82ae83785ed7 +ENV CONTAINERD_COMMIT v0.2.1 RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \ diff --git a/hack/vendor.sh b/hack/vendor.sh index 7ef5bf0384720..edc4590e432f0 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -90,5 +90,5 @@ clone git google.golang.org/api dc6d2353af16e2a2b0ff6986af051d473a4ed468 https:/ clone git google.golang.org/cloud dae7e3d993bc3812a2185af60552bb6b847e52a0 https://code.googlesource.com/gocloud # containerd -clone git github.com/docker/containerd 07c95162cdcead88dfe4ca0ffb3cea02375ec54d +clone git github.com/docker/containerd v0.2.1 clean diff --git a/vendor/src/github.com/docker/containerd/api/grpc/types/api.pb.go b/vendor/src/github.com/docker/containerd/api/grpc/types/api.pb.go index 85eda97ca491f..ea82960490cbc 100644 --- a/vendor/src/github.com/docker/containerd/api/grpc/types/api.pb.go +++ b/vendor/src/github.com/docker/containerd/api/grpc/types/api.pb.go @@ -469,14 +469,14 @@ func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } type NetworkStats struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - RxBytes uint64 `protobuf:"varint,2,opt,name=rx_bytes" json:"rx_bytes,omitempty"` - Rx_Packets uint64 `protobuf:"varint,3,opt,name=rx_Packets" json:"rx_Packets,omitempty"` - RxErrors uint64 `protobuf:"varint,4,opt,name=Rx_errors" json:"Rx_errors,omitempty"` - RxDropped uint64 `protobuf:"varint,5,opt,name=Rx_dropped" json:"Rx_dropped,omitempty"` - TxBytes uint64 `protobuf:"varint,6,opt,name=Tx_bytes" json:"Tx_bytes,omitempty"` - TxPackets uint64 `protobuf:"varint,7,opt,name=Tx_packets" json:"Tx_packets,omitempty"` - TxErrors uint64 `protobuf:"varint,8,opt,name=Tx_errors" json:"Tx_errors,omitempty"` - TxDropped uint64 `protobuf:"varint,9,opt,name=Tx_dropped" json:"Tx_dropped,omitempty"` + RxBytes uint64 `protobuf:"varint,2,opt,name=rx_bytes,json=rxBytes" json:"rx_bytes,omitempty"` + Rx_Packets uint64 `protobuf:"varint,3,opt,name=rx_Packets,json=rxPackets" json:"rx_Packets,omitempty"` + RxErrors uint64 `protobuf:"varint,4,opt,name=Rx_errors,json=rxErrors" json:"Rx_errors,omitempty"` + RxDropped uint64 `protobuf:"varint,5,opt,name=Rx_dropped,json=rxDropped" json:"Rx_dropped,omitempty"` + TxBytes uint64 `protobuf:"varint,6,opt,name=Tx_bytes,json=txBytes" json:"Tx_bytes,omitempty"` + TxPackets uint64 `protobuf:"varint,7,opt,name=Tx_packets,json=txPackets" json:"Tx_packets,omitempty"` + TxErrors uint64 `protobuf:"varint,8,opt,name=Tx_errors,json=txErrors" json:"Tx_errors,omitempty"` + TxDropped uint64 `protobuf:"varint,9,opt,name=Tx_dropped,json=txDropped" json:"Tx_dropped,omitempty"` } func (m *NetworkStats) Reset() { *m = NetworkStats{} } @@ -485,10 +485,10 @@ func (*NetworkStats) ProtoMessage() {} func (*NetworkStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } type CpuUsage struct { - TotalUsage uint64 `protobuf:"varint,1,opt,name=total_usage" json:"total_usage,omitempty"` - PercpuUsage []uint64 `protobuf:"varint,2,rep,name=percpu_usage" json:"percpu_usage,omitempty"` - UsageInKernelmode uint64 `protobuf:"varint,3,opt,name=usage_in_kernelmode" json:"usage_in_kernelmode,omitempty"` - UsageInUsermode uint64 `protobuf:"varint,4,opt,name=usage_in_usermode" json:"usage_in_usermode,omitempty"` + TotalUsage uint64 `protobuf:"varint,1,opt,name=total_usage,json=totalUsage" json:"total_usage,omitempty"` + PercpuUsage []uint64 `protobuf:"varint,2,rep,name=percpu_usage,json=percpuUsage" json:"percpu_usage,omitempty"` + UsageInKernelmode uint64 `protobuf:"varint,3,opt,name=usage_in_kernelmode,json=usageInKernelmode" json:"usage_in_kernelmode,omitempty"` + UsageInUsermode uint64 `protobuf:"varint,4,opt,name=usage_in_usermode,json=usageInUsermode" json:"usage_in_usermode,omitempty"` } func (m *CpuUsage) Reset() { *m = CpuUsage{} } @@ -498,8 +498,8 @@ func (*CpuUsage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29 type ThrottlingData struct { Periods uint64 `protobuf:"varint,1,opt,name=periods" json:"periods,omitempty"` - ThrottledPeriods uint64 `protobuf:"varint,2,opt,name=throttled_periods" json:"throttled_periods,omitempty"` - ThrottledTime uint64 `protobuf:"varint,3,opt,name=throttled_time" json:"throttled_time,omitempty"` + ThrottledPeriods uint64 `protobuf:"varint,2,opt,name=throttled_periods,json=throttledPeriods" json:"throttled_periods,omitempty"` + ThrottledTime uint64 `protobuf:"varint,3,opt,name=throttled_time,json=throttledTime" json:"throttled_time,omitempty"` } func (m *ThrottlingData) Reset() { *m = ThrottlingData{} } @@ -508,9 +508,9 @@ func (*ThrottlingData) ProtoMessage() {} func (*ThrottlingData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } type CpuStats struct { - CpuUsage *CpuUsage `protobuf:"bytes,1,opt,name=cpu_usage" json:"cpu_usage,omitempty"` - ThrottlingData *ThrottlingData `protobuf:"bytes,2,opt,name=throttling_data" json:"throttling_data,omitempty"` - SystemUsage uint64 `protobuf:"varint,3,opt,name=system_usage" json:"system_usage,omitempty"` + CpuUsage *CpuUsage `protobuf:"bytes,1,opt,name=cpu_usage,json=cpuUsage" json:"cpu_usage,omitempty"` + ThrottlingData *ThrottlingData `protobuf:"bytes,2,opt,name=throttling_data,json=throttlingData" json:"throttling_data,omitempty"` + SystemUsage uint64 `protobuf:"varint,3,opt,name=system_usage,json=systemUsage" json:"system_usage,omitempty"` } func (m *CpuStats) Reset() { *m = CpuStats{} } @@ -534,6 +534,7 @@ func (m *CpuStats) GetThrottlingData() *ThrottlingData { type PidsStats struct { Current uint64 `protobuf:"varint,1,opt,name=current" json:"current,omitempty"` + Limit uint64 `protobuf:"varint,2,opt,name=limit" json:"limit,omitempty"` } func (m *PidsStats) Reset() { *m = PidsStats{} } @@ -543,7 +544,7 @@ func (*PidsStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3 type MemoryData struct { Usage uint64 `protobuf:"varint,1,opt,name=usage" json:"usage,omitempty"` - MaxUsage uint64 `protobuf:"varint,2,opt,name=max_usage" json:"max_usage,omitempty"` + MaxUsage uint64 `protobuf:"varint,2,opt,name=max_usage,json=maxUsage" json:"max_usage,omitempty"` Failcnt uint64 `protobuf:"varint,3,opt,name=failcnt" json:"failcnt,omitempty"` Limit uint64 `protobuf:"varint,4,opt,name=limit" json:"limit,omitempty"` } @@ -556,8 +557,8 @@ func (*MemoryData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{ type MemoryStats struct { Cache uint64 `protobuf:"varint,1,opt,name=cache" json:"cache,omitempty"` Usage *MemoryData `protobuf:"bytes,2,opt,name=usage" json:"usage,omitempty"` - SwapUsage *MemoryData `protobuf:"bytes,3,opt,name=swap_usage" json:"swap_usage,omitempty"` - KernelUsage *MemoryData `protobuf:"bytes,4,opt,name=kernel_usage" json:"kernel_usage,omitempty"` + SwapUsage *MemoryData `protobuf:"bytes,3,opt,name=swap_usage,json=swapUsage" json:"swap_usage,omitempty"` + KernelUsage *MemoryData `protobuf:"bytes,4,opt,name=kernel_usage,json=kernelUsage" json:"kernel_usage,omitempty"` Stats map[string]uint64 `protobuf:"bytes,5,rep,name=stats" json:"stats,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` } @@ -607,14 +608,14 @@ func (*BlkioStatsEntry) ProtoMessage() {} func (*BlkioStatsEntry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } type BlkioStats struct { - IoServiceBytesRecursive []*BlkioStatsEntry `protobuf:"bytes,1,rep,name=io_service_bytes_recursive" json:"io_service_bytes_recursive,omitempty"` - IoServicedRecursive []*BlkioStatsEntry `protobuf:"bytes,2,rep,name=io_serviced_recursive" json:"io_serviced_recursive,omitempty"` - IoQueuedRecursive []*BlkioStatsEntry `protobuf:"bytes,3,rep,name=io_queued_recursive" json:"io_queued_recursive,omitempty"` - IoServiceTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,4,rep,name=io_service_time_recursive" json:"io_service_time_recursive,omitempty"` - IoWaitTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,5,rep,name=io_wait_time_recursive" json:"io_wait_time_recursive,omitempty"` - IoMergedRecursive []*BlkioStatsEntry `protobuf:"bytes,6,rep,name=io_merged_recursive" json:"io_merged_recursive,omitempty"` - IoTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,7,rep,name=io_time_recursive" json:"io_time_recursive,omitempty"` - SectorsRecursive []*BlkioStatsEntry `protobuf:"bytes,8,rep,name=sectors_recursive" json:"sectors_recursive,omitempty"` + IoServiceBytesRecursive []*BlkioStatsEntry `protobuf:"bytes,1,rep,name=io_service_bytes_recursive,json=ioServiceBytesRecursive" json:"io_service_bytes_recursive,omitempty"` + IoServicedRecursive []*BlkioStatsEntry `protobuf:"bytes,2,rep,name=io_serviced_recursive,json=ioServicedRecursive" json:"io_serviced_recursive,omitempty"` + IoQueuedRecursive []*BlkioStatsEntry `protobuf:"bytes,3,rep,name=io_queued_recursive,json=ioQueuedRecursive" json:"io_queued_recursive,omitempty"` + IoServiceTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,4,rep,name=io_service_time_recursive,json=ioServiceTimeRecursive" json:"io_service_time_recursive,omitempty"` + IoWaitTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,5,rep,name=io_wait_time_recursive,json=ioWaitTimeRecursive" json:"io_wait_time_recursive,omitempty"` + IoMergedRecursive []*BlkioStatsEntry `protobuf:"bytes,6,rep,name=io_merged_recursive,json=ioMergedRecursive" json:"io_merged_recursive,omitempty"` + IoTimeRecursive []*BlkioStatsEntry `protobuf:"bytes,7,rep,name=io_time_recursive,json=ioTimeRecursive" json:"io_time_recursive,omitempty"` + SectorsRecursive []*BlkioStatsEntry `protobuf:"bytes,8,rep,name=sectors_recursive,json=sectorsRecursive" json:"sectors_recursive,omitempty"` } func (m *BlkioStats) Reset() { *m = BlkioStats{} } @@ -680,7 +681,7 @@ func (m *BlkioStats) GetSectorsRecursive() []*BlkioStatsEntry { type HugetlbStats struct { Usage uint64 `protobuf:"varint,1,opt,name=usage" json:"usage,omitempty"` - MaxUsage uint64 `protobuf:"varint,2,opt,name=max_usage" json:"max_usage,omitempty"` + MaxUsage uint64 `protobuf:"varint,2,opt,name=max_usage,json=maxUsage" json:"max_usage,omitempty"` Failcnt uint64 `protobuf:"varint,3,opt,name=failcnt" json:"failcnt,omitempty"` Limit uint64 `protobuf:"varint,4,opt,name=limit" json:"limit,omitempty"` } @@ -691,11 +692,11 @@ func (*HugetlbStats) ProtoMessage() {} func (*HugetlbStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } type CgroupStats struct { - CpuStats *CpuStats `protobuf:"bytes,1,opt,name=cpu_stats" json:"cpu_stats,omitempty"` - MemoryStats *MemoryStats `protobuf:"bytes,2,opt,name=memory_stats" json:"memory_stats,omitempty"` - BlkioStats *BlkioStats `protobuf:"bytes,3,opt,name=blkio_stats" json:"blkio_stats,omitempty"` - HugetlbStats map[string]*HugetlbStats `protobuf:"bytes,4,rep,name=hugetlb_stats" json:"hugetlb_stats,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - PidsStats *PidsStats `protobuf:"bytes,5,opt,name=pids_stats" json:"pids_stats,omitempty"` + CpuStats *CpuStats `protobuf:"bytes,1,opt,name=cpu_stats,json=cpuStats" json:"cpu_stats,omitempty"` + MemoryStats *MemoryStats `protobuf:"bytes,2,opt,name=memory_stats,json=memoryStats" json:"memory_stats,omitempty"` + BlkioStats *BlkioStats `protobuf:"bytes,3,opt,name=blkio_stats,json=blkioStats" json:"blkio_stats,omitempty"` + HugetlbStats map[string]*HugetlbStats `protobuf:"bytes,4,rep,name=hugetlb_stats,json=hugetlbStats" json:"hugetlb_stats,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + PidsStats *PidsStats `protobuf:"bytes,5,opt,name=pids_stats,json=pidsStats" json:"pids_stats,omitempty"` } func (m *CgroupStats) Reset() { *m = CgroupStats{} } @@ -739,8 +740,8 @@ func (m *CgroupStats) GetPidsStats() *PidsStats { } type StatsResponse struct { - NetworkStats []*NetworkStats `protobuf:"bytes,1,rep,name=network_stats" json:"network_stats,omitempty"` - CgroupStats *CgroupStats `protobuf:"bytes,2,opt,name=cgroup_stats" json:"cgroup_stats,omitempty"` + NetworkStats []*NetworkStats `protobuf:"bytes,1,rep,name=network_stats,json=networkStats" json:"network_stats,omitempty"` + CgroupStats *CgroupStats `protobuf:"bytes,2,opt,name=cgroup_stats,json=cgroupStats" json:"cgroup_stats,omitempty"` Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` } @@ -1182,118 +1183,144 @@ var _API_serviceDesc = grpc.ServiceDesc{ } var fileDescriptor0 = []byte{ - // 1806 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xd4, 0x58, 0xd9, 0x8e, 0xdb, 0x5e, - 0x19, 0x9f, 0xec, 0xc9, 0x97, 0x38, 0x33, 0xe3, 0xd9, 0x32, 0xe9, 0x36, 0xb8, 0x85, 0x56, 0xa8, - 0x1a, 0x95, 0x94, 0xa5, 0x14, 0x09, 0x51, 0xa6, 0x15, 0x05, 0x4d, 0x4b, 0x3a, 0x0b, 0x88, 0xab, - 0xc8, 0xb1, 0x4f, 0x93, 0xc3, 0x38, 0xb6, 0xf1, 0x39, 0x9e, 0xe5, 0x21, 0xb8, 0xe5, 0x9a, 0x7b, - 0x24, 0xc4, 0x15, 0x0f, 0xc0, 0xb3, 0x70, 0xc5, 0x53, 0xf0, 0x9d, 0xc5, 0x8e, 0xed, 0x2c, 0x83, - 0x84, 0xfe, 0x17, 0xff, 0x9b, 0x28, 0xe7, 0x9c, 0x6f, 0xfd, 0x7d, 0xd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xd8, 0xd8, 0xbb, 0xa2, 0xc1, 0xef, 0xd5, 0x2c, 0x56, - 0xce, 0x63, 0x96, 0x21, 0x14, 0xe7, 0xd8, 0xf0, 0x50, 0x62, 0x39, 0xb3, 0x35, 0x24, 0x11, 0x0d, - 0x54, 0x13, 0x34, 0x44, 0x82, 0xe3, 0xd6, 0x97, 0x38, 0xe0, 0xb6, 0x9e, 0xe9, 0x62, 0xde, 0x22, - 0x84, 0x84, 0x9f, 0x08, 0x20, 0x6b, 0xe9, 0x0c, 0x96, 0x7b, 0x9f, 0xc8, 0x8c, 0xe9, 0x2c, 0x46, - 0xa5, 0x0a, 0xdc, 0x53, 0x91, 0x14, 0x3a, 0x8f, 0x91, 0x50, 0x6d, 0x9e, 0xdf, 0xd8, 0xa1, 0x4c, - 0x66, 0x03, 0x2b, 0x66, 0x5b, 0xed, 0xa1, 0xbd, 0x24, 0xba, 0xb6, 0x45, 0x3b, 0x95, 0x79, 0x2d, - 0x8f, 0xae, 0x48, 0xe4, 0x13, 0xef, 0x53, 0x46, 0x12, 0xc8, 0xa1, 0x78, 0x08, 0x07, 0x0b, 0x98, - 0xea, 0x6e, 0x65, 0x81, 0xf1, 0xe1, 0x9a, 0x60, 0x3b, 0x48, 0x50, 0x46, 0xbf, 0x44, 0x3a, 0x20, - 0xa0, 0xb3, 0x50, 0x7a, 0x5f, 0xb5, 0xbe, 0x40, 0x4d, 0xd2, 0x14, 0xe6, 0x81, 0x8a, 0xc7, 0xb2, - 0x10, 0x18, 0x49, 0x7c, 0xaa, 0x49, 0x8d, 0xce, 0x45, 0xd6, 0xa4, 0xc8, 0x7f, 0x96, 0xa0, 0xf3, - 0x99, 0xf0, 0x9b, 0x20, 0xba, 0x12, 0x59, 0xc4, 0x0a, 0x2d, 0x10, 0x91, 0x8c, 0x6e, 0x47, 0xe3, - 0x3b, 0xae, 0xe1, 0xae, 0x0a, 0x30, 0x70, 0x67, 0x68, 0xab, 0xc6, 0x27, 0x87, 0x8e, 0x90, 0x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0xdc, 0xfe, 0xa3, 0x15, 0xa7, 0xa9, 0xc0, - 0x1f, 0x42, 0x4d, 0xbd, 0x19, 0x93, 0x8c, 0xcf, 0x3e, 0x33, 0xfb, 0xbb, 0xf9, 0xcd, 0x94, 0xeb, - 0x15, 0xd4, 0xd5, 0x15, 0x35, 0x4d, 0x80, 0xdc, 0x8d, 0xb5, 0xdf, 0xc9, 0xee, 0x5a, 0x1b, 0xaf, - 0x4a, 0x89, 0x1e, 0x96, 0xd3, 0xc3, 0x96, 0xe9, 0xc9, 0x04, 0x67, 0x5c, 0x97, 0x9f, 0xf8, 0x5e, - 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0xee, 0xbf, 0x26, 0x33, 0xef, 0x13, 0x00, 0x00, + // 2212 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x39, 0x4b, 0x73, 0x1c, 0x49, + 0xd1, 0x9e, 0xa7, 0x34, 0x39, 0x0f, 0x49, 0x6d, 0x3d, 0xc6, 0xb3, 0x6b, 0xaf, 0xbf, 0x8e, 0x0f, + 0xd6, 0xc0, 0x22, 0x8c, 0xbc, 0x1b, 0x38, 0x20, 0x20, 0x62, 0x2d, 0x1b, 0x30, 0x6b, 0x2d, 0x72, + 0x4b, 0x8a, 0xbd, 0x10, 0x31, 0xd1, 0x9a, 0x2e, 0xcf, 0x34, 0xea, 0xe9, 0xee, 0xed, 0xae, 0xd1, + 0xe3, 0xc2, 0x11, 0x6e, 0x1c, 0xb9, 0x10, 0xc1, 0x85, 0x1b, 0x77, 0x0e, 0xfc, 0x02, 0xfe, 0x09, + 0xb1, 0x3f, 0x81, 0x23, 0x59, 0x95, 0xd5, 0x55, 0xd5, 0xf3, 0x90, 0x96, 0x03, 0xc1, 0x85, 0xcb, + 0x44, 0xe5, 0xa3, 0x32, 0xb3, 0xf2, 0x55, 0xd9, 0x35, 0xd0, 0xf2, 0xd3, 0x70,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 0xc6, 0x35, + 0xf8, 0x60, 0x25, 0xdd, 0x16, 0x3b, 0xff, 0x76, 0xa6, 0xc5, 0xae, 0x78, 0x93, 0xd3, 0x62, 0x57, + 0x3e, 0xba, 0xdd, 0x73, 0x7e, 0x09, 0xbd, 0xf2, 0x6b, 0x96, 0x53, 0x38, 0x69, 0xe9, 0x6b, 0xdc, + 0xe0, 0xe1, 0x0a, 0xaa, 0x16, 0xf8, 0x31, 0x34, 0xe8, 0x99, 0xaa, 0xa8, 0x0d, 0xfb, 0x75, 0x6b, + 0xb0, 0x5d, 0x46, 0xea, 0x5d, 0x4f, 0xa1, 0x49, 0x5f, 0x60, 0x3a, 0x01, 0x4a, 0x1f, 0x64, 0x83, + 0x8e, 0x8d, 0x75, 0xef, 0x3d, 0xad, 0x14, 0x7a, 0xf2, 0x92, 0x9e, 0x7c, 0x99, 0x1e, 0x2b, 0x38, + 0xe7, 0x4d, 0xf9, 0x2f, 0xcf, 0xb3, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x9a, 0x70, 0x70, 0x7d, + 0xf2, 0x19, 0x00, 0x00, } diff --git a/vendor/src/github.com/docker/containerd/api/grpc/types/api.proto b/vendor/src/github.com/docker/containerd/api/grpc/types/api.proto index 8cc1477932198..da26b1be2b806 100644 --- a/vendor/src/github.com/docker/containerd/api/grpc/types/api.proto +++ b/vendor/src/github.com/docker/containerd/api/grpc/types/api.proto @@ -232,6 +232,7 @@ message CpuStats { message PidsStats { uint64 current = 1; + uint64 limit = 2; } message MemoryData { From dc984199eb8a107509b294a1392c56aacb3b72e4 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Fri, 22 Apr 2016 09:23:56 -0700 Subject: [PATCH 17/22] Use absolute path for rootfs in OCI config.json This avoid an extra bind mount within /var/run/docker/libcontainerd This should resolve situations where a container having the host /var/run bound prevents other containers from being cleanly removed (e.g. #21969). Signed-off-by: Kenfe-Mickael Laventure (cherry picked from commit 313587454334f455334dac8d32cfb96f949a29a0) --- libcontainerd/client_linux.go | 36 ++++++++++++++++---------------- libcontainerd/container_linux.go | 1 - 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/libcontainerd/client_linux.go b/libcontainerd/client_linux.go index 01806da889d4f..8eab75126549d 100644 --- a/libcontainerd/client_linux.go +++ b/libcontainerd/client_linux.go @@ -163,15 +163,9 @@ func (clnt *client) Create(containerID string, spec Spec, options ...CreateOptio } }() - // uid/gid - rootfsDir := filepath.Join(container.dir, "rootfs") - if err := idtools.MkdirAllAs(rootfsDir, 0700, uid, gid); err != nil && !os.IsExist(err) { + if err := idtools.MkdirAllAs(container.dir, 0700, uid, gid); err != nil && !os.IsExist(err) { return err } - if err := syscall.Mount(spec.Root.Path, rootfsDir, "bind", syscall.MS_REC|syscall.MS_BIND, ""); err != nil { - return err - } - spec.Root.Path = "rootfs" f, err := os.Create(filepath.Join(container.dir, configFilename)) if err != nil { @@ -258,6 +252,22 @@ func (clnt *client) Stats(containerID string) (*Stats, error) { return (*Stats)(resp), nil } +// Take care of the old 1.11.0 behavior in case the version upgrade +// happenned without a clean daemon shutdown +func (clnt *client) cleanupOldRootfs(containerID string) { + // Unmount and delete the bundle folder + if mts, err := mount.GetMounts(); err == nil { + for _, mts := range mts { + if strings.HasSuffix(mts.Mountpoint, containerID+"/rootfs") { + if err := syscall.Unmount(mts.Mountpoint, syscall.MNT_DETACH); err == nil { + os.RemoveAll(strings.TrimSuffix(mts.Mountpoint, "/rootfs")) + } + break + } + } + } +} + func (clnt *client) setExited(containerID string) error { clnt.lock(containerID) defer clnt.unlock(containerID) @@ -273,17 +283,7 @@ func (clnt *client) setExited(containerID string) error { ExitCode: exitCode, }) - // Unmount and delete the bundle folder - if mts, err := mount.GetMounts(); err == nil { - for _, mts := range mts { - if strings.HasSuffix(mts.Mountpoint, containerID+"/rootfs") { - if err := syscall.Unmount(mts.Mountpoint, syscall.MNT_DETACH); err == nil { - os.RemoveAll(strings.TrimSuffix(mts.Mountpoint, "/rootfs")) - } - break - } - } - } + clnt.cleanupOldRootfs(containerID) return err } diff --git a/libcontainerd/container_linux.go b/libcontainerd/container_linux.go index 561e55db11dd8..1e8fb0b318888 100644 --- a/libcontainerd/container_linux.go +++ b/libcontainerd/container_linux.go @@ -33,7 +33,6 @@ func (ctr *container) clean() error { return err } - syscall.Unmount(filepath.Join(ctr.dir, "rootfs"), syscall.MNT_DETACH) // ignore error if err := os.RemoveAll(ctr.dir); err != nil { return err } From 0c8c9bada985d76aa75d38959873acb7219943dd Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Sat, 23 Apr 2016 12:59:17 -0700 Subject: [PATCH 18/22] Labels set on the command line always override labels in Dockerfile This fix tries to address the inconsistency in #22036 where labels set on the command line will not override labels specified in Dockerfile, but will override labels inherited from `FROM` images. The fix add a LABEL with command line options at the end of the processed Dockerfile so that command line options labels always override the LABEL in Dockerfiles (or through `FROM`). An integration test has been added for test cases specified in #22036. This fix fixes #22036. NOTE: Some changes are from #22266 (@tiborvass). Signed-off-by: Yong Tang (cherry picked from commit 5844736c14b29860ea03b040e9a052e59ad75bfc) --- builder/dockerfile/builder.go | 26 +++---- builder/dockerfile/internals.go | 28 +------ builder/dockerfile/parser/line_parsers.go | 2 +- builder/dockerfile/parser/parser.go | 10 +-- integration-cli/docker_cli_build_test.go | 91 +++++++++++++++++++++++ 5 files changed, 110 insertions(+), 47 deletions(-) diff --git a/builder/dockerfile/builder.go b/builder/dockerfile/builder.go index 37cca99f91f3a..daa704989e2ad 100644 --- a/builder/dockerfile/builder.go +++ b/builder/dockerfile/builder.go @@ -216,12 +216,20 @@ func (b *Builder) build(config *types.ImageBuildOptions, context builder.Context return "", err } + if len(b.options.Labels) > 0 { + line := "LABEL " + for k, v := range b.options.Labels { + line += fmt.Sprintf("%q=%q ", k, v) + } + _, node, err := parser.ParseLine(line) + if err != nil { + return "", err + } + b.dockerfile.Children = append(b.dockerfile.Children, node) + } + var shortImgID string for i, n := range b.dockerfile.Children { - // we only want to add labels to the last layer - if i == len(b.dockerfile.Children)-1 { - b.addLabels() - } select { case <-b.cancelled: logrus.Debug("Builder: build cancelled!") @@ -237,16 +245,6 @@ func (b *Builder) build(config *types.ImageBuildOptions, context builder.Context return "", err } - // Commit the layer when there are only one children in - // the dockerfile, this is only the `FROM` tag, and - // build labels. Otherwise, the new image won't be - // labeled properly. - // Commit here, so the ID of the final image is reported - // properly. - if len(b.dockerfile.Children) == 1 && len(b.options.Labels) > 0 { - b.commit("", b.runConfig.Cmd, "") - } - shortImgID = stringid.TruncateID(b.image) fmt.Fprintf(b.Stdout, " ---> %s\n", shortImgID) if b.options.Remove { diff --git a/builder/dockerfile/internals.go b/builder/dockerfile/internals.go index 33da91161d19e..a9be9fdd9facb 100644 --- a/builder/dockerfile/internals.go +++ b/builder/dockerfile/internals.go @@ -37,19 +37,6 @@ import ( "github.com/docker/engine-api/types/strslice" ) -func (b *Builder) addLabels() { - // merge labels - if len(b.options.Labels) > 0 { - logrus.Debugf("[BUILDER] setting labels %v", b.options.Labels) - if b.runConfig.Labels == nil { - b.runConfig.Labels = make(map[string]string) - } - for kL, vL := range b.options.Labels { - b.runConfig.Labels[kL] = vL - } - } -} - func (b *Builder) commit(id string, autoCmd strslice.StrSlice, comment string) error { if b.disableCommit { return nil @@ -413,20 +400,7 @@ func (b *Builder) processImageFrom(img builder.Image) error { b.image = img.ImageID() if img.RunConfig() != nil { - imgConfig := *img.RunConfig() - // inherit runConfig labels from the current - // state if they've been set already. - // Ensures that images with only a FROM - // get the labels populated properly. - if b.runConfig.Labels != nil { - if imgConfig.Labels == nil { - imgConfig.Labels = make(map[string]string) - } - for k, v := range b.runConfig.Labels { - imgConfig.Labels[k] = v - } - } - b.runConfig = &imgConfig + b.runConfig = img.RunConfig() } } diff --git a/builder/dockerfile/parser/line_parsers.go b/builder/dockerfile/parser/line_parsers.go index 8cfd39bb2f9ad..1d7ece43dce69 100644 --- a/builder/dockerfile/parser/line_parsers.go +++ b/builder/dockerfile/parser/line_parsers.go @@ -34,7 +34,7 @@ func parseSubCommand(rest string) (*Node, map[string]bool, error) { return nil, nil, nil } - _, child, err := parseLine(rest) + _, child, err := ParseLine(rest) if err != nil { return nil, nil, err } diff --git a/builder/dockerfile/parser/parser.go b/builder/dockerfile/parser/parser.go index d16683a75686a..ece601a957d82 100644 --- a/builder/dockerfile/parser/parser.go +++ b/builder/dockerfile/parser/parser.go @@ -68,8 +68,8 @@ func init() { } } -// parse a line and return the remainder. -func parseLine(line string) (string, *Node, error) { +// ParseLine parse a line and return the remainder. +func ParseLine(line string) (string, *Node, error) { if line = stripComments(line); line == "" { return "", nil, nil } @@ -111,7 +111,7 @@ func Parse(rwc io.Reader) (*Node, error) { for scanner.Scan() { scannedLine := strings.TrimLeftFunc(scanner.Text(), unicode.IsSpace) currentLine++ - line, child, err := parseLine(scannedLine) + line, child, err := ParseLine(scannedLine) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func Parse(rwc io.Reader) (*Node, error) { continue } - line, child, err = parseLine(line + newline) + line, child, err = ParseLine(line + newline) if err != nil { return nil, err } @@ -136,7 +136,7 @@ func Parse(rwc io.Reader) (*Node, error) { } } if child == nil && line != "" { - _, child, err = parseLine(line) + _, child, err = ParseLine(line) if err != nil { return nil, err } diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index fa0bf46118168..a53df642bb134 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -6883,3 +6883,94 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestBuildWithExternalAuth(c *check.C) out, _, err := runCommandWithOutput(buildCmd) c.Assert(err, check.IsNil, check.Commentf(out)) } + +// Test cases in #22036 +func (s *DockerSuite) TestBuildLabelsOverride(c *check.C) { + testRequires(c, DaemonIsLinux) + + // Command line option labels will always override + name := "scratchy" + expected := `{"bar":"from-flag","foo":"from-flag"}` + _, err := buildImage(name, + `FROM scratch + LABEL foo=from-dockerfile`, + true, "--label", "foo=from-flag", "--label", "bar=from-flag") + c.Assert(err, check.IsNil) + + res := inspectFieldJSON(c, name, "Config.Labels") + if res != expected { + c.Fatalf("Labels %s, expected %s", res, expected) + } + + name = "from" + expected = `{"foo":"from-dockerfile"}` + _, err = buildImage(name, + `FROM scratch + LABEL foo from-dockerfile`, + true) + c.Assert(err, check.IsNil) + + res = inspectFieldJSON(c, name, "Config.Labels") + if res != expected { + c.Fatalf("Labels %s, expected %s", res, expected) + } + + // Command line option label will override even via `FROM` + name = "new" + expected = `{"bar":"from-dockerfile2","foo":"new"}` + _, err = buildImage(name, + `FROM from + LABEL bar from-dockerfile2`, + true, "--label", "foo=new") + c.Assert(err, check.IsNil) + + res = inspectFieldJSON(c, name, "Config.Labels") + if res != expected { + c.Fatalf("Labels %s, expected %s", res, expected) + } + + // Command line option without a value set (--label foo, --label bar=) + // will be treated as --label foo="", --label bar="" + name = "scratchy2" + expected = `{"bar":"","foo":""}` + _, err = buildImage(name, + `FROM scratch + LABEL foo=from-dockerfile`, + true, "--label", "foo", "--label", "bar=") + c.Assert(err, check.IsNil) + + res = inspectFieldJSON(c, name, "Config.Labels") + if res != expected { + c.Fatalf("Labels %s, expected %s", res, expected) + } + + // Command line option without a value set (--label foo, --label bar=) + // will be treated as --label foo="", --label bar="" + // This time is for inherited images + name = "new2" + expected = `{"bar":"","foo":""}` + _, err = buildImage(name, + `FROM from + LABEL bar from-dockerfile2`, + true, "--label", "foo=", "--label", "bar") + c.Assert(err, check.IsNil) + + res = inspectFieldJSON(c, name, "Config.Labels") + if res != expected { + c.Fatalf("Labels %s, expected %s", res, expected) + } + + // Command line option labels with only `FROM` + name = "scratchy" + expected = `{"bar":"from-flag","foo":"from-flag"}` + _, err = buildImage(name, + `FROM scratch`, + true, "--label", "foo=from-flag", "--label", "bar=from-flag") + c.Assert(err, check.IsNil) + + res = inspectFieldJSON(c, name, "Config.Labels") + if res != expected { + c.Fatalf("Labels %s, expected %s", res, expected) + } + +} From 3b8c11b1b30a5a1ec49d2d15f91156c877e8f830 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 25 Apr 2016 15:57:28 +0200 Subject: [PATCH 19/22] fix reloading of daemon labels from config commit 20a038eca68e4188e1cd812293aea8cb220cf08f changed daemon configuration reloading to check if a value was actually set, however, it checked for the wrong property ("label" instead of "labels"), which resulted in the labels only to be loaded from daemon.json if both a "label" -and- a "labels" property was present. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 455858fc70e3b752fb2495bbdda368613e6587c2) --- daemon/daemon.go | 2 +- daemon/daemon_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index 43b3e48ef40bb..b2102b646d383 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -1605,7 +1605,7 @@ func (daemon *Daemon) initDiscovery(config *Config) error { func (daemon *Daemon) Reload(config *Config) error { daemon.configStore.reloadLock.Lock() defer daemon.configStore.reloadLock.Unlock() - if config.IsValueSet("label") { + if config.IsValueSet("labels") { daemon.configStore.Labels = config.Labels } if config.IsValueSet("debug") { diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 382aac29e33ae..da6bc25d8877f 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -320,7 +320,7 @@ func TestDaemonReloadLabels(t *testing.T) { } valuesSets := make(map[string]interface{}) - valuesSets["label"] = "foo:baz" + valuesSets["labels"] = "foo:baz" newConfig := &Config{ CommonConfig: CommonConfig{ Labels: []string{"foo:baz"}, @@ -345,7 +345,7 @@ func TestDaemonReloadNotAffectOthers(t *testing.T) { } valuesSets := make(map[string]interface{}) - valuesSets["label"] = "foo:baz" + valuesSets["labels"] = "foo:baz" newConfig := &Config{ CommonConfig: CommonConfig{ Labels: []string{"foo:baz"}, From c06a4c22bbe3f84e995f43e21a7365c37a0a2194 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Fri, 22 Apr 2016 20:00:47 -0700 Subject: [PATCH 20/22] Add default `serveraddress` value in remote API `/auth` This fix tries to address the issue in #22244 where the remote API `/auth` will not set the default value of `serveraddress` if not provided. This behavior happens after only in 1.11.0 and is a regression as in 1.10.3 `serveraddress` will be assigned with `IndexServer` if no value is provided. The default value `IndexServer` is assigned to `serveraddress` if no value provided in this fix. An integration test `TestAuthApi` has been added to cover this change This fix fixes #22244. Signed-off-by: Yong Tang (cherry picked from commit 93973196f4b4dafae5b94eb541a3b752ea48f66e) --- integration-cli/docker_api_auth_test.go | 23 +++++++++++++++++++++++ registry/service.go | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 integration-cli/docker_api_auth_test.go diff --git a/integration-cli/docker_api_auth_test.go b/integration-cli/docker_api_auth_test.go new file mode 100644 index 0000000000000..63e78ab520f65 --- /dev/null +++ b/integration-cli/docker_api_auth_test.go @@ -0,0 +1,23 @@ +package main + +import ( + "net/http" + + "github.com/docker/docker/pkg/integration/checker" + "github.com/docker/engine-api/types" + "github.com/go-check/check" +) + +// Test case for #22244 +func (s *DockerSuite) TestAuthApi(c *check.C) { + config := types.AuthConfig{ + Username: "no-user", + Password: "no-password", + } + + expected := "Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password\n" + status, body, err := sockRequest("POST", "/auth", config) + c.Assert(err, check.IsNil) + c.Assert(status, check.Equals, http.StatusUnauthorized) + c.Assert(string(body), checker.Contains, expected, check.Commentf("Expected: %v, got: %v", expected, string(body))) +} diff --git a/registry/service.go b/registry/service.go index acafc34b60f81..cdeca585c7b1b 100644 --- a/registry/service.go +++ b/registry/service.go @@ -37,6 +37,9 @@ func (s *Service) ServiceConfig() *registrytypes.ServiceConfig { // It can be used to verify the validity of a client's credentials. func (s *Service) Auth(authConfig *types.AuthConfig, userAgent string) (status, token string, err error) { serverAddress := authConfig.ServerAddress + if serverAddress == "" { + serverAddress = IndexServer + } if !strings.HasPrefix(serverAddress, "https://") && !strings.HasPrefix(serverAddress, "http://") { serverAddress = "https://" + serverAddress } From ab1be6f66774937bbbfbf9c20591164c190d7c47 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 18 Apr 2016 13:10:15 -0700 Subject: [PATCH 21/22] Reset restart timeout if execution longer than 10s Restore the 1.10 logic that will reset the restart manager's timeout or backoff delay if a container executes longer than 10s reguardless of exit status or policy. Signed-off-by: Michael Crosby (cherry picked from commit b6db56b5eba00c4e8ad7a6f6c5b018e15dc883eb) Signed-off-by: Kenfe-Mickael Laventure --- container/container.go | 4 ++-- daemon/daemon.go | 2 +- libcontainerd/container.go | 2 ++ libcontainerd/container_linux.go | 4 +++- libcontainerd/container_windows.go | 4 +++- restartmanager/restartmanager.go | 9 ++++++-- restartmanager/restartmanager_test.go | 33 ++++++++++++++++++++++++++- 7 files changed, 50 insertions(+), 8 deletions(-) diff --git a/container/container.go b/container/container.go index 58892e7788cb4..ebafde7a0a011 100644 --- a/container/container.go +++ b/container/container.go @@ -516,9 +516,9 @@ func copyEscapable(dst io.Writer, src io.ReadCloser, keys []byte) (written int64 return written, err } -// ShouldRestart decides whether the daemon should restart the container or not. +// ShouldRestartOnBoot decides whether the daemon should restart the container or not. // This is based on the container's restart policy. -func (container *Container) ShouldRestart() bool { +func (container *Container) ShouldRestartOnBoot() bool { return container.HostConfig.RestartPolicy.Name == "always" || (container.HostConfig.RestartPolicy.Name == "unless-stopped" && !container.HasBeenManuallyStopped) || (container.HostConfig.RestartPolicy.Name == "on-failure" && container.ExitCode != 0) diff --git a/daemon/daemon.go b/daemon/daemon.go index b2102b646d383..b7eadaa9aca7b 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -309,7 +309,7 @@ func (daemon *Daemon) restore() error { } // fixme: only if not running // get list of containers we need to restart - if daemon.configStore.AutoRestart && !c.IsRunning() && !c.IsPaused() && c.ShouldRestart() { + if daemon.configStore.AutoRestart && !c.IsRunning() && !c.IsPaused() && c.ShouldRestartOnBoot() { mapLock.Lock() restartContainers[c] = make(chan struct{}) mapLock.Unlock() diff --git a/libcontainerd/container.go b/libcontainerd/container.go index 197990f2b218f..30bc95028cc4b 100644 --- a/libcontainerd/container.go +++ b/libcontainerd/container.go @@ -2,6 +2,7 @@ package libcontainerd import ( "fmt" + "time" "github.com/docker/docker/restartmanager" ) @@ -18,6 +19,7 @@ type containerCommon struct { restartManager restartmanager.RestartManager restarting bool processes map[string]*process + startedAt time.Time } // WithRestartManager sets the restartmanager to be used with the container. diff --git a/libcontainerd/container_linux.go b/libcontainerd/container_linux.go index 1e8fb0b318888..7fa6770b586ed 100644 --- a/libcontainerd/container_linux.go +++ b/libcontainerd/container_linux.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" "syscall" + "time" "github.com/Sirupsen/logrus" containerd "github.com/docker/containerd/api/grpc/types" @@ -90,6 +91,7 @@ func (ctr *container) start() error { ctr.closeFifos(iopipe) return err } + ctr.startedAt = time.Now() if err := ctr.client.backend.AttachStreams(ctr.containerID, *iopipe); err != nil { return err @@ -131,7 +133,7 @@ func (ctr *container) handleEvent(e *containerd.Event) error { st.State = StateExitProcess } if st.State == StateExit && ctr.restartManager != nil { - restart, wait, err := ctr.restartManager.ShouldRestart(e.Status) + restart, wait, err := ctr.restartManager.ShouldRestart(e.Status, false, time.Since(ctr.startedAt)) if err != nil { logrus.Warnf("container %s %v", ctr.containerID, err) } else if restart { diff --git a/libcontainerd/container_windows.go b/libcontainerd/container_windows.go index f1df64aa4f107..b07141ab26b75 100644 --- a/libcontainerd/container_windows.go +++ b/libcontainerd/container_windows.go @@ -4,6 +4,7 @@ import ( "io" "strings" "syscall" + "time" "github.com/Microsoft/hcsshim" "github.com/Sirupsen/logrus" @@ -78,6 +79,7 @@ func (ctr *container) start() error { } return err } + ctr.startedAt = time.Now() // Convert io.ReadClosers to io.Readers if stdout != nil { @@ -164,7 +166,7 @@ func (ctr *container) waitExit(pid uint32, processFriendlyName string, isFirstPr defer ctr.client.unlock(ctr.containerID) if si.State == StateExit && ctr.restartManager != nil { - restart, wait, err := ctr.restartManager.ShouldRestart(uint32(exitCode)) + restart, wait, err := ctr.restartManager.ShouldRestart(uint32(exitCode), false, time.Since(ctr.startedAt)) if err != nil { logrus.Error(err) } else if restart { diff --git a/restartmanager/restartmanager.go b/restartmanager/restartmanager.go index 41f44098c0487..0e844de2363d6 100644 --- a/restartmanager/restartmanager.go +++ b/restartmanager/restartmanager.go @@ -21,7 +21,7 @@ var ErrRestartCanceled = errors.New("restart canceled") // RestartManager defines object that controls container restarting rules. type RestartManager interface { Cancel() error - ShouldRestart(exitCode uint32) (bool, chan error, error) + ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error) } type restartManager struct { @@ -46,7 +46,7 @@ func (rm *restartManager) SetPolicy(policy container.RestartPolicy) { rm.Unlock() } -func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, error) { +func (rm *restartManager) ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error) { if rm.policy.IsNone() { return false, nil, nil } @@ -72,6 +72,11 @@ func (rm *restartManager) ShouldRestart(exitCode uint32) (bool, chan error, erro rm.failureCount = 0 } + // if the container ran for more than 10s, reguardless of status and policy reset the + // the timeout back to the default. + if executionDuration.Seconds() >= 10 { + rm.timeout = 0 + } if rm.timeout == 0 { rm.timeout = defaultTimeout } else { diff --git a/restartmanager/restartmanager_test.go b/restartmanager/restartmanager_test.go index 22f6a0c20ef0e..9c9f805eb3b83 100644 --- a/restartmanager/restartmanager_test.go +++ b/restartmanager/restartmanager_test.go @@ -1,3 +1,34 @@ package restartmanager -// FIXME +import ( + "testing" + "time" + + "github.com/docker/engine-api/types/container" +) + +func TestRestartManagerTimeout(t *testing.T) { + rm := New(container.RestartPolicy{Name: "always", MaximumRetryCount: 0}).(*restartManager) + should, _, err := rm.ShouldRestart(0, false, 1*time.Second) + if err != nil { + t.Fatal(err) + } + if !should { + t.Fatal("container should be restarted") + } + if rm.timeout != 100*time.Millisecond { + t.Fatalf("restart manager should have a timeout of 100ms but has %s", rm.timeout) + } +} + +func TestRestartManagerTimeoutReset(t *testing.T) { + rm := New(container.RestartPolicy{Name: "always", MaximumRetryCount: 0}).(*restartManager) + rm.timeout = 5 * time.Second + _, _, err := rm.ShouldRestart(0, false, 10*time.Second) + if err != nil { + t.Fatal(err) + } + if rm.timeout != 100*time.Millisecond { + t.Fatalf("restart manager should have a timeout of 100ms but has %s", rm.timeout) + } +} From 61c0f4bc3e435cda55e9d21cf5f8af748c1e8015 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 25 Apr 2016 12:55:28 -0700 Subject: [PATCH 22/22] Update runc and spec dependencies for mount label Signed-off-by: Mrunal Patel Set up the mount label in the spec for a container Signed-off-by: Mrunal Patel (cherry picked from commit e0f98c698b49e3790fe63bff611eeda6f5b46055) Signed-off-by: Kenfe-Mickael Laventure --- Dockerfile | 2 +- Dockerfile.aarch64 | 2 +- Dockerfile.armhf | 2 +- Dockerfile.gccgo | 2 +- Dockerfile.ppc64le | 2 +- Dockerfile.s390x | 2 +- Dockerfile.simple | 2 +- daemon/oci_linux.go | 1 + hack/vendor.sh | 2 +- vendor/src/github.com/opencontainers/specs/specs-go/config.go | 4 +++- .../src/github.com/opencontainers/specs/specs-go/version.go | 2 +- 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 65ff87f7f65a8..119bbdc3ecae0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -248,7 +248,7 @@ RUN set -x \ && rm -rf "$GOPATH" # Install runc -ENV RUNC_COMMIT e87436998478d222be209707503c27f6f91be0c5 +ENV RUNC_COMMIT baf6536d6259209c3edfa2b22237af82942d3dfa RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index b26424d6c8e30..ec59c7ebc3af4 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -181,7 +181,7 @@ RUN set -x \ && rm -rf "$GOPATH" # Install runc -ENV RUNC_COMMIT e87436998478d222be209707503c27f6f91be0c5 +ENV RUNC_COMMIT baf6536d6259209c3edfa2b22237af82942d3dfa RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 739f5db10b9eb..5fd488055ae4c 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -200,7 +200,7 @@ RUN set -x \ && rm -rf "$GOPATH" # Install runc -ENV RUNC_COMMIT e87436998478d222be209707503c27f6f91be0c5 +ENV RUNC_COMMIT baf6536d6259209c3edfa2b22237af82942d3dfa RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ diff --git a/Dockerfile.gccgo b/Dockerfile.gccgo index 30500e3eccaf3..1156a97330850 100644 --- a/Dockerfile.gccgo +++ b/Dockerfile.gccgo @@ -74,7 +74,7 @@ WORKDIR /go/src/github.com/docker/docker ENV DOCKER_BUILDTAGS apparmor seccomp selinux # Install runc -ENV RUNC_COMMIT e87436998478d222be209707503c27f6f91be0c5 +ENV RUNC_COMMIT baf6536d6259209c3edfa2b22237af82942d3dfa RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le index dc559c902739a..2b7411e799042 100644 --- a/Dockerfile.ppc64le +++ b/Dockerfile.ppc64le @@ -199,7 +199,7 @@ RUN set -x \ && rm -rf "$GOPATH" # Install runc -ENV RUNC_COMMIT e87436998478d222be209707503c27f6f91be0c5 +ENV RUNC_COMMIT baf6536d6259209c3edfa2b22237af82942d3dfa RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ diff --git a/Dockerfile.s390x b/Dockerfile.s390x index 929ce92e61854..00b551e01f93c 100644 --- a/Dockerfile.s390x +++ b/Dockerfile.s390x @@ -178,7 +178,7 @@ RUN set -x \ && rm -rf "$GOPATH" # Install runc -ENV RUNC_COMMIT e87436998478d222be209707503c27f6f91be0c5 +ENV RUNC_COMMIT baf6536d6259209c3edfa2b22237af82942d3dfa RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ diff --git a/Dockerfile.simple b/Dockerfile.simple index 2113af6cdd273..aabadadacc6cf 100644 --- a/Dockerfile.simple +++ b/Dockerfile.simple @@ -30,7 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* # Install runc -ENV RUNC_COMMIT e87436998478d222be209707503c27f6f91be0c5 +ENV RUNC_COMMIT baf6536d6259209c3edfa2b22237af82942d3dfa RUN set -x \ && export GOPATH="$(mktemp -d)" \ && git clone git://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \ diff --git a/daemon/oci_linux.go b/daemon/oci_linux.go index ca9ed020f322e..0c3636ce1d47f 100644 --- a/daemon/oci_linux.go +++ b/daemon/oci_linux.go @@ -671,6 +671,7 @@ func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e } s.Process.SelinuxLabel = c.GetProcessLabel() s.Process.NoNewPrivileges = c.NoNewPrivileges + s.Linux.MountLabel = c.MountLabel return (*libcontainerd.Spec)(&s), nil } diff --git a/hack/vendor.sh b/hack/vendor.sh index edc4590e432f0..e5a65477f4cfe 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -61,7 +61,7 @@ clone git github.com/docker/go v1.5.1-1-1-gbaf439e clone git github.com/agl/ed25519 d2b94fd789ea21d12fac1a4443dd3a3f79cda72c clone git github.com/opencontainers/runc 7b6c4c418d5090f4f11eee949fdf49afd15838c9 # libcontainer -clone git github.com/opencontainers/specs 93ca97e83ca7fb4fba6d9e30d5470f99ddc02d11 # specs +clone git github.com/opencontainers/specs f955d90e70a98ddfb886bd930ffd076da9b67998 # specs clone git github.com/seccomp/libseccomp-golang 1b506fc7c24eec5a3693cdcbed40d9c226cfc6a1 # libcontainer deps (see src/github.com/opencontainers/runc/Godeps/Godeps.json) clone git github.com/coreos/go-systemd v4 diff --git a/vendor/src/github.com/opencontainers/specs/specs-go/config.go b/vendor/src/github.com/opencontainers/specs/specs-go/config.go index 3e5d499e88834..45e604cc3d729 100644 --- a/vendor/src/github.com/opencontainers/specs/specs-go/config.go +++ b/vendor/src/github.com/opencontainers/specs/specs-go/config.go @@ -49,7 +49,7 @@ type Process struct { // ApparmorProfile specified the apparmor profile for the container. (this field is platform dependent) ApparmorProfile string `json:"apparmorProfile,omitempty" platform:"linux"` - // SelinuxProcessLabel specifies the selinux context that the container process is run as. (this field is platform dependent) + // SelinuxLabel specifies the selinux context that the container process is run as. (this field is platform dependent) SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` } @@ -140,6 +140,8 @@ type Linux struct { MaskedPaths []string `json:"maskedPaths,omitempty"` // ReadonlyPaths sets the provided paths as RO inside the container. ReadonlyPaths []string `json:"readonlyPaths,omitempty"` + // MountLabel specifies the selinux context for the mounts in the container. + MountLabel string `json:"mountLabel,omitempty"` } // Namespace is the configuration for a Linux namespace diff --git a/vendor/src/github.com/opencontainers/specs/specs-go/version.go b/vendor/src/github.com/opencontainers/specs/specs-go/version.go index 27f45e08b3c76..371289aea5734 100644 --- a/vendor/src/github.com/opencontainers/specs/specs-go/version.go +++ b/vendor/src/github.com/opencontainers/specs/specs-go/version.go @@ -6,7 +6,7 @@ const ( // VersionMajor is for an API incompatible changes VersionMajor = 0 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 5 + VersionMinor = 6 // VersionPatch is for backwards-compatible bug fixes VersionPatch = 0