docker / docker/cli

docker cp with bash process substitution does not copy the content of the file

Open
#2,183 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

I would like to be able to use bash process substitution with docker cp :

docker cp <(echo "hello world") nginx:/hello
docker exec -ti nginx cat /hello

And see "hello world"

Describe the results you received:

cat: /hello: No such file or directory

Describe the results you expected:

See "hello world"

Additional information you deem important (e.g. issue happens only occasionally):

Most commands support process substitution like this, for example :

cp <(echo "hello") hello
cat <(echo hello)

Output of docker version:

$ docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.1
 Git commit:        2d0083d
 Built:             Fri Aug 16 14:20:06 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.1
  Git commit:       2d0083d
  Built:            Wed Aug 14 19:41:23 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker info:

Containers: 37
 Running: 31
 Paused: 0
 Stopped: 6
Images: 1057
Server Version: 18.09.7
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version:
runc version: N/A
init version: v0.18.0 (expected: fec3683b971d9c3ef73f284f176672c44b448662)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-65-generic
Operating System: Ubuntu 18.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.42GiB
Name: edgar
ID: P2Z2:LWW2:2LF3:DDHP:E2CR:K57E:73RD:GNR6:PH6Y:UQBT:VAI2:HRGO
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: ehippaltair
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented docker cp <(echo "hello world") nginx:/hello command and inspect the docker cp CLI path handling process-substitution input. Done means the command copies the generated content into the container so that docker exec -ti nginx cat /hello prints "hello world".

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, docker, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.