Skip to content

Commit 86046b4

Browse files
committed
bump docker/docker to a30990b3c8d0d42280fa501287859e1d2393a951
full diff: moby/moby@b6684a4...a30990b relevant changes: - moby/moby#39995 Update containerd binary to v1.2.10 - moby/moby#40001 Update runc to v1.0.0-rc8-92-g84373aaa (CVE-2019-16884) - moby/moby#39999 bump golang 1.13.1 (CVE-2019-16276) - moby/moby#40102 bump golang 1.13.3 (CVE-2019-17596) - moby/moby#39994 homedir: add cgo or osusergo buildtag constraints for unix. This is to ensure that users of the homedir package cannot compile statically (`CGO_ENABLED=0`) without also setting the `osusergo` build tag. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 146d29c commit 86046b4

File tree

35 files changed

+136
-98
lines changed

35 files changed

+136
-98
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ clean: ## remove build artifacts
1212

1313
.PHONY: test-unit
1414
test-unit: ## run unit tests, to change the output format use: GOTESTSUM_FORMAT=(dots|short|standard-quiet|short-verbose|standard-verbose) make test-unit
15-
gotestsum $(TESTFLAGS) -- $${TESTDIRS:-$(shell go list ./... | grep -vE '/vendor/|/e2e/')}
15+
gotestsum $(TESTFLAGS) -- -tags osusergo $${TESTDIRS:-$(shell go list ./... | grep -vE '/vendor/|/e2e/')}
1616

1717
.PHONY: test
1818
test: test-unit ## run tests
1919

2020
.PHONY: test-coverage
2121
test-coverage: ## run test coverage
22-
gotestsum -- -coverprofile=coverage.txt $(shell go list ./... | grep -vE '/vendor/|/e2e/')
22+
gotestsum -- -tags osusergo -coverprofile=coverage.txt $(shell go list ./... | grep -vE '/vendor/|/e2e/')
2323

2424
.PHONY: fmt
2525
fmt:

cli/command/container/hijack.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ func setRawTerminal(streams command.Streams) error {
185185
return streams.Out().SetRawTerminal()
186186
}
187187

188-
// nolint: unparam
189188
func restoreTerminal(streams command.Streams, in io.Closer) error {
190189
streams.In().RestoreTerminal()
191190
streams.Out().RestoreTerminal()

cli/command/formatter/reflect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func (d *dummy) Func1() string {
1212
return "Func1"
1313
}
1414

15-
func (d *dummy) func2() string { // nolint: unused
15+
func (d *dummy) func2() string {
1616
return "func2(should not be marshalled)"
1717
}
1818

cli/command/image/trust.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ func convertTarget(t client.Target) (target, error) {
344344
}
345345

346346
// TagTrusted tags a trusted ref
347-
// nolint: interfacer
348347
func TagTrusted(ctx context.Context, cli command.Cli, trustedRef reference.Canonical, ref reference.NamedTagged) error {
349348
// Use familiar references when interacting with client and output
350349
familiarRef := reference.FamiliarString(ref)

cli/command/manifest/push.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ func buildBlobRequestList(imageManifest types.ImageManifest, repoName reference.
208208
return blobReqs, nil
209209
}
210210

211-
// nolint: interfacer
212211
func buildPutManifestRequest(imageManifest types.ImageManifest, targetRef reference.Named) (mountRequest, error) {
213212
refWithoutTag, err := reference.WithName(targetRef.Name())
214213
if err != nil {

cli/command/trust/signer_remove.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func isLastSignerForReleases(roleWithSig data.Role, allRoles []client.RoleWithSi
7878

7979
// removeSingleSigner attempts to remove a single signer and returns whether signer removal happened.
8080
// The signer not being removed doesn't necessarily raise an error e.g. user choosing "No" when prompted for confirmation.
81-
// nolint: unparam
8281
func removeSingleSigner(cli command.Cli, repoName, signerName string, forceYes bool) (bool, error) {
8382
ctx := context.Background()
8483
imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, image.AuthResolver(cli), repoName)

cli/config/config.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import (
66
"os"
77
"path/filepath"
88
"strings"
9+
"sync"
10+
11+
"github.com/docker/docker/pkg/homedir"
912

1013
"github.com/docker/cli/cli/config/configfile"
1114
"github.com/docker/cli/cli/config/credentials"
1215
"github.com/docker/cli/cli/config/types"
13-
"github.com/docker/docker/pkg/homedir"
1416
"github.com/pkg/errors"
1517
)
1618

@@ -23,17 +25,20 @@ const (
2325
)
2426

2527
var (
26-
configDir = os.Getenv("DOCKER_CONFIG")
28+
initConfigDir sync.Once
29+
configDir string
2730
)
2831

29-
func init() {
32+
func setConfigDir() {
33+
configDir = os.Getenv("DOCKER_CONFIG")
3034
if configDir == "" {
3135
configDir = filepath.Join(homedir.Get(), configFileDir)
3236
}
3337
}
3438

3539
// Dir returns the directory the configuration file is stored in
3640
func Dir() string {
41+
initConfigDir.Do(setConfigDir)
3742
return configDir
3843
}
3944

gometalinter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Vendor": true,
2+
"Vendor": false,
33
"Deadline": "2m",
44
"Sort": ["linter", "severity", "path", "line"],
55
"Exclude": [

scripts/build/binary

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ source ./scripts/build/.variables
99

1010
echo "Building statically linked $TARGET"
1111
export CGO_ENABLED=0
12-
go build -o "${TARGET}" --ldflags "${LDFLAGS}" "${SOURCE}"
12+
echo go build -o "${TARGET}" -tags osusergo --ldflags "${LDFLAGS}" "${SOURCE}"
13+
go build -o "${TARGET}" -tags osusergo --ldflags "${LDFLAGS}" "${SOURCE}"
1314

1415
ln -sf "$(basename "${TARGET}")" build/docker

scripts/build/plugins

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ for p in cli-plugins/examples/* "$@" ; do
1717

1818
echo "Building statically linked $TARGET"
1919
export CGO_ENABLED=0
20-
go build -o "${TARGET}" --ldflags "${LDFLAGS}" "github.com/docker/cli/${p}"
20+
go build -o "${TARGET}" -tags osusergo --ldflags "${LDFLAGS}" "github.com/docker/cli/${p}"
2121
done

0 commit comments

Comments
 (0)