Description
I think since "new bash completion" the completion for docker stack deploy (-c arg) does not work like before
Reproduce
- Open Terminal
- Enable bash completion
docker stack deploy -c <PRESS TAB for bash file completion>
Expected behavior
-c ... does not complete filenames but it should
If you enter something or delete -c and press TAB you see it only completes stack names
docker version
Client: Docker Engine - Community
Version: 29.1.2
API version: 1.52
Go version: go1.25.5
Git commit: 890dcca
Built: Tue Dec 2 21:55:45 2025
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 29.1.2
API version: 1.52 (minimum version 1.44)
Go version: go1.25.5
Git commit: de45c2a
Built: Tue Dec 2 21:55:45 2025
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: v2.2.0
GitCommit: 1c4457e00facac03ce1d75f7b6777a7a851e5c41
runc:
Version: 1.3.4
GitCommit: v1.3.4-0-gd6d73eb8
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client: Docker Engine - Community
Version: 29.1.2
Context: default
Debug Mode: false
Server:
Containers: 6
Running: 5
Paused: 0
Stopped: 1
Images: 19
Server Version: 29.1.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Additional Info
cobra.ShellCompDirectiveNoFileComp could be the cause
|
ValidArgsFunction: completeNames(dockerCLI), |
|
return names, cobra.ShellCompDirectiveNoFileComp |
Description
I think since "new bash completion" the completion for docker stack deploy (
-carg) does not work like beforeReproduce
docker stack deploy -c <PRESS TAB for bash file completion>Expected behavior
-c... does not complete filenames but it shouldIf you enter something or delete
-cand press TAB you see it only completes stack namesdocker version
Client: Docker Engine - Community Version: 29.1.2 API version: 1.52 Go version: go1.25.5 Git commit: 890dcca Built: Tue Dec 2 21:55:45 2025 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 29.1.2 API version: 1.52 (minimum version 1.44) Go version: go1.25.5 Git commit: de45c2a Built: Tue Dec 2 21:55:45 2025 OS/Arch: linux/amd64 Experimental: true containerd: Version: v2.2.0 GitCommit: 1c4457e00facac03ce1d75f7b6777a7a851e5c41 runc: Version: 1.3.4 GitCommit: v1.3.4-0-gd6d73eb8 docker-init: Version: 0.19.0 GitCommit: de40ad0docker info
Additional Info
cobra.ShellCompDirectiveNoFileCompcould be the causecli/cli/command/stack/deploy.go
Line 48 in 890dcca
cli/cli/command/stack/cmd.go
Line 64 in 890dcca