Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

filename completion on `docker load -i`

未关闭 适合新手
#7,402 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@cra 已经在做这个了。

开始于 2026年10月17日。

  • #7403 来自 @cra —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, docker, go
领域
cli

调研方向

从 cli/command/image/load.go 开始,其中 docker load -i 注册其标志和补全行为。使用 docker __complete load -i '' 复现,并将其补全设置与 docker compose -f 使用的文件扩展名补全进行比较。完成意味着 -i 的值能够补全文件名,而不是返回 ShellCompDirectiveNoFileComp,并且相关的 CLI 测试覆盖此行为。

由索引模型根据 Issue 内容生成。

描述

kind/feature status/0-triage
Description

Hi!

Sometimes when testing my containers I ship them between machines first to ensure I didn't miss anything when building the image. I do it by

docker save <image:tag> | gzip > my_image.tar.gz

and then scp it to a vps remote where I load it with

docker load -i my_image.tar.gz

the problem that I noticed is that the tab completion is not working on the load command. I'm pretty sure it's a docker cli isssue not my shell as

$ docker __complete load -i ''                     
:4
Completion ended with directive: ShellCompDirectiveNoFileComp

compared for example for compose

$ docker __complete compose -f ''
yaml
yml
:8
Completion ended with directive: ShellCompDirectiveFilterFileExt

fix suggestion

pretty sure it's in cli/command/image/load.go where the command registers completions

version and info

$ docker version       
Client:
 Version:           29.9.0
 API version:       1.56
 Go version:        go1.27.1-X:nodwarf5
 Git commit:        f415da838b
 Built:             Fri Oct  9 00:19:20 2026
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          29.9.0
  API version:      1.56 (minimum version 1.40)
  Go version:       go1.27.1-X:nodwarf5
  Git commit:       a5b58c94d3
  Built:            Fri Oct  9 00:19:20 2026
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v2.4.1
  GitCommit:        f2551031d7276a770f65f98c9b52e57e7dad07e8.m
 runc:
  Version:          1.5.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
$ docker info                                         
Client:
 Version:    29.9.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.38.0
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  5.6.0
    Path:     /usr/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 20
  Running: 4
  Paused: 0
  Stopped: 16
 Images: 122
 Server Version: 29.9.0
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 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
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: f2551031d7276a770f65f98c9b52e57e7dad07e8.m
 runc version: 
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 7.2.9-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.07GiB
 Name: pintsize
 ID: 76e4d802-aba2-4177-b4f4-d8eadd9c2ff4
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
  ::1/128
 Live Restore Enabled: false
 Firewall Backend: iptables
  EnableUserlandProxy: true
  UserlandProxyPath: /usr/bin/docker-proxy
主要语言
Go
星标
6.1k
派生
2.2k
平均合并
15 小时 11 分钟
30 天内合并 PR
42

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/cli 的其他 Issue

查看 docker/cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。