You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shell completion for docker cp has a few usability issues that make completing file paths quite frustrating.
1. Host File Path Tilde Expansion
When trying to copy files to or from the host, the shell completion script neglects to expand tildes. Ideally docker cp completion would work similar to shell builtins like cp, where typing docker cp ~ and tabbing for completion results would show files/directories in my home directory.
2. Container Path Completion
Shell completion for docker cp does not provide completion results for files on the container.
I could see this as being a bit more tricky to fix, I'm not even sure how you'd do it.
3. Default Copy Location
When copying files to a container, if no destination is provided (e.g. docker cp myfile container:), files should be copied to the location indicated by the first WORKDIR directive. scp behaves in this way; when no destination is provided the file is uploaded to $HOME.
Steps to reproduce the issue:
Type docker cp ~ in your shell and tab for completion results.
Create a file in your CWD named 'test-file'.
Start (any) container by running docker run --rm -d --name "docker_cp_test" debian:latest tail -F /dev/null
Type docker cp test-file docker_cp_test: in your shell and tab for completion results.
Describe the results you received:
No completion results are shown for files/directories in my home directory. Additionally, docker does not provide shell completion results for files/directories in the container.
Describe the results you expected:
I expect the that completion results are shown for files/directories in my home directory. Docker should provide shell completion results for files/directories in the container.
Output of docker version:
Client: Docker Engine - Community
Version: 20.10.5
API version: 1.40
Go version: go1.13.15
Git commit: 55c4c88
Built: Tue Mar 2 20:17:50 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 19.03.14
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 5eb3275d40
Built: Tue Dec 1 19:18:50 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.4
GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
runc:
Version: 1.0.0-rc93
GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
docker-init:
Version: 0.18.0
GitCommit: fec3683
Description
Shell completion for
docker cp
has a few usability issues that make completing file paths quite frustrating.1. Host File Path Tilde Expansion
When trying to copy files to or from the host, the shell completion script neglects to expand tildes. Ideally
docker cp
completion would work similar to shell builtins likecp
, where typingdocker cp ~
and tabbing for completion results would show files/directories in my home directory.2. Container Path Completion
Shell completion for
docker cp
does not provide completion results for files on the container.I could see this as being a bit more tricky to fix, I'm not even sure how you'd do it.
3. Default Copy Location
When copying files to a container, if no destination is provided (e.g.
docker cp myfile container:
), files should be copied to the location indicated by the firstWORKDIR
directive.scp
behaves in this way; when no destination is provided the file is uploaded to$HOME
.Steps to reproduce the issue:
docker cp ~
in your shell and tab for completion results.docker run --rm -d --name "docker_cp_test" debian:latest tail -F /dev/null
docker cp test-file docker_cp_test:
in your shell and tab for completion results.Describe the results you received:
No completion results are shown for files/directories in my home directory. Additionally, docker does not provide shell completion results for files/directories in the container.
Describe the results you expected:
I expect the that completion results are shown for files/directories in my home directory. Docker should provide shell completion results for files/directories in the container.
Output of
docker version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: