Skip to content

Commit 340f288

Browse files
authored
Merge pull request moby#29962 from vieux/1.13.0-rc6-cherrypicks
1.13.0 rc6 cherrypicks
2 parents 0b2a029 + 46af2ed commit 340f288

File tree

12 files changed

+40
-39
lines changed

12 files changed

+40
-39
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ To manually remove all plugins and resolve this problem, take the following step
110110
* Remove `--name` from `docker volume create` [#23830](https://github.com/docker/docker/pull/23830)
111111
+ Add `docker stack ls` [#23886](https://github.com/docker/docker/pull/23886)
112112
+ Add a new `is-task` ps filter [#24411](https://github.com/docker/docker/pull/24411)
113-
+ Add `--env-file` flag to `docker create service` [#24844](https://github.com/docker/docker/pull/24844)
113+
+ Add `--env-file` flag to `docker service create` [#24844](https://github.com/docker/docker/pull/24844)
114114
+ Add `--format` on `docker stats` [#24987](https://github.com/docker/docker/pull/24987)
115115
+ Make `docker node ps` default to `self` in swarm node [#25214](https://github.com/docker/docker/pull/25214)
116116
+ Add `--group` in `docker service create` [#25317](https://github.com/docker/docker/pull/25317)

builder/dockerfile/dispatchers.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,19 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
297297
}
298298
b.runConfig.Image = b.image
299299

300+
cmd := b.runConfig.Cmd
301+
comment := "WORKDIR " + b.runConfig.WorkingDir
302+
// reset the command for cache detection
303+
b.runConfig.Cmd = strslice.StrSlice(append(getShell(b.runConfig), "#(nop) "+comment))
304+
defer func(cmd strslice.StrSlice) { b.runConfig.Cmd = cmd }(cmd)
305+
300306
if hit, err := b.probeCache(); err != nil {
301307
return err
302308
} else if hit {
303309
return nil
304310
}
305311

306-
// Actually copy the struct
307-
workdirConfig := *b.runConfig
308-
workdirConfig.Cmd = strslice.StrSlice(append(getShell(b.runConfig), fmt.Sprintf("#(nop) WORKDIR %s", b.runConfig.WorkingDir)))
309-
310-
container, err := b.docker.ContainerCreate(types.ContainerCreateConfig{Config: &workdirConfig})
312+
container, err := b.docker.ContainerCreate(types.ContainerCreateConfig{Config: b.runConfig})
311313
if err != nil {
312314
return err
313315
}
@@ -316,7 +318,7 @@ func workdir(b *Builder, args []string, attributes map[string]bool, original str
316318
return err
317319
}
318320

319-
return b.commit(container.ID, b.runConfig.Cmd, "WORKDIR "+b.runConfig.WorkingDir)
321+
return b.commit(container.ID, cmd, comment)
320322
}
321323

322324
// RUN some command yo

cli/command/secret/create.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ func newSecretCreateCommand(dockerCli *command.DockerCli) *cobra.Command {
2727
}
2828

2929
cmd := &cobra.Command{
30-
Use: "create [OPTIONS] SECRET",
30+
Use: "create [OPTIONS] SECRET file|-",
3131
Short: "Create a secret from a file or STDIN as content",
32-
Args: cli.ExactArgs(1),
32+
Args: cli.ExactArgs(2),
3333
RunE: func(cmd *cobra.Command, args []string) error {
3434
createOpts.name = args[0]
35+
createOpts.file = args[1]
3536
return runSecretCreate(dockerCli, createOpts)
3637
},
3738
}
3839
flags := cmd.Flags()
3940
flags.VarP(&createOpts.labels, "label", "l", "Secret labels")
40-
flags.StringVarP(&createOpts.file, "file", "f", "", "Read from a file or STDIN ('-')")
4141

4242
return cmd
4343
}
@@ -46,10 +46,6 @@ func runSecretCreate(dockerCli *command.DockerCli, options createOptions) error
4646
client := dockerCli.Client()
4747
ctx := context.Background()
4848

49-
if options.file == "" {
50-
return fmt.Errorf("Please specify either a file name or STDIN ('-') with --file")
51-
}
52-
5349
var in io.Reader = dockerCli.In()
5450
if options.file != "-" {
5551
file, err := system.OpenSequential(options.file)

contrib/completion/bash/docker

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# DOCKER_COMPLETION_SHOW_CONTAINER_IDS
2424
# DOCKER_COMPLETION_SHOW_NETWORK_IDS
2525
# DOCKER_COMPLETION_SHOW_NODE_IDS
26+
# DOCKER_COMPLETION_SHOW_PLUGIN_IDS
2627
# DOCKER_COMPLETION_SHOW_SECRET_IDS
2728
# DOCKER_COMPLETION_SHOW_SERVICE_IDS
2829
# "no" - Show names only (default)
@@ -286,9 +287,17 @@ __docker_complete_plugins_bundled() {
286287

287288
# __docker_plugins_installed returns a list of all plugins that were installed with
288289
# the Docker plugin API.
290+
# By default, only names are returned.
291+
# Set DOCKER_COMPLETION_SHOW_PLUGIN_IDS=yes to also complete IDs.
289292
# For built-in pugins, see `__docker_plugins_bundled`.
290293
__docker_plugins_installed() {
291-
__docker_q plugin ls | awk 'NR>1 {print $1}'
294+
local fields
295+
if [ "$DOCKER_COMPLETION_SHOW_PLUGIN_IDS" = yes ] ; then
296+
fields='$1,$2'
297+
else
298+
fields='$2'
299+
fi
300+
__docker_q plugin ls | awk "NR>1 {print $fields}"
292301
}
293302

294303
# __docker_complete_plugins_installed applies completion of plugins that were installed

contrib/completion/zsh/_docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ __docker_image_subcommand() {
917917
"($help)*--label=[Set metadata for an image]:label=value: " \
918918
"($help -m --memory)"{-m=,--memory=}"[Memory limit]:Memory limit: " \
919919
"($help)--memory-swap=[Total memory limit with swap]:Memory limit: " \
920-
"($help)--network=[Connect a container to a network]:network mode:(bridge none container host)"
920+
"($help)--network=[Connect a container to a network]:network mode:(bridge none container host)" \
921921
"($help)--no-cache[Do not use cache when building the image]" \
922922
"($help)--pull[Attempt to pull a newer version of the image]" \
923923
"($help -q --quiet)"{-q,--quiet}"[Suppress verbose build output]" \

docs/reference/commandline/secret_create.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ keywords: ["secret, create"]
1616
# secret create
1717

1818
```Markdown
19-
Usage: docker secret create [OPTIONS] SECRET
19+
Usage: docker secret create [OPTIONS] SECRET file|-
2020

2121
Create a secret from a file or STDIN as content
2222

2323
Options:
24-
-f, --file string Read from a file or STDIN ('-')
2524
--help Print usage
2625
-l, --label list Secret labels (default [])
2726
```
@@ -34,7 +33,7 @@ command on a manager node.
3433
### Create a secret
3534

3635
```bash
37-
$ echo <secret> | docker secret create -f - my_secret
36+
$ echo <secret> | docker secret create my_secret -
3837
mhv17xfe3gh6xc4rij5orpfds
3938

4039
$ docker secret ls
@@ -45,7 +44,7 @@ mhv17xfe3gh6xc4rij5orpfds my_secret 2016-10-27 23:25:43.90918108
4544
### Create a secret with a file
4645

4746
```bash
48-
$ docker secret create -f secret.json my_secret
47+
$ docker secret create my_secret ./secret.json
4948
mhv17xfe3gh6xc4rij5orpfds
5049

5150
$ docker secret ls
@@ -56,7 +55,7 @@ mhv17xfe3gh6xc4rij5orpfds my_secret 2016-10-27 23:25:43.90918108
5655
### Create a secret with labels
5756

5857
```bash
59-
$ docker secret create -f secret.json --label env=dev --label rev=20161102 my_secret
58+
$ docker secret create --label env=dev --label rev=20161102 my_secret ./secret.json
6059
jtn7g6aukl5ky7nr9gvwafoxh
6160

6261
$ docker secret inspect my_secret

integration-cli/docker_cli_authz_plugin_v2_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
)
1212

1313
var (
14-
authzPluginName = "tonistiigi/authz-no-volume-plugin"
14+
authzPluginName = "riyaz/authz-no-volume-plugin"
1515
authzPluginTag = "latest"
1616
authzPluginNameWithTag = authzPluginName + ":" + authzPluginTag
17-
authzPluginBadManifestName = "tonistiigi/authz-plugin-bad-manifest"
17+
authzPluginBadManifestName = "riyaz/authz-plugin-bad-manifest"
1818
nonexistentAuthzPluginName = "riyaz/nonexistent-authz-plugin"
1919
)
2020

integration-cli/docker_cli_build_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7383,6 +7383,10 @@ func (s *DockerSuite) TestBuildWorkdirCmd(c *check.C) {
73837383
FROM golang:1.7-alpine
73847384
WORKDIR /
73857385
`
7386-
_, err := buildImage("testbuildworkdircmd", dockerFile, false)
7386+
_, err := buildImage("testbuildworkdircmd", dockerFile, true)
73877387
c.Assert(err, checker.IsNil)
7388+
7389+
_, out, err := buildImageWithOut("testbuildworkdircmd", dockerFile, true)
7390+
c.Assert(err, checker.IsNil)
7391+
c.Assert(strings.Count(out, "Using cache"), checker.Equals, 1)
73887392
}

integration-cli/docker_cli_network_unix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ func (s *DockerNetworkSuite) TestDockerPluginV2NetworkDriver(c *check.C) {
772772
testRequires(c, DaemonIsLinux, IsAmd64, Network)
773773

774774
var (
775-
npName = "tonistiigi/test-docker-netplugin"
775+
npName = "tiborvass/test-docker-netplugin"
776776
npTag = "latest"
777777
npNameWithTag = npName + ":" + npTag
778778
)

integration-cli/docker_cli_plugins_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515

1616
var (
1717
pluginProcessName = "sample-volume-plugin"
18-
pName = "tonistiigi/sample-volume-plugin"
19-
npName = "tonistiigi/test-docker-netplugin"
18+
pName = "tiborvass/sample-volume-plugin"
19+
npName = "tiborvass/test-docker-netplugin"
2020
pTag = "latest"
2121
pNameWithTag = pName + ":" + pTag
2222
npNameWithTag = npName + ":" + pTag

0 commit comments

Comments
 (0)