Cli: "docker cp" seems to be broken on OSX

Created on 3 Apr 2018  ·  3Comments  ·  Source: docker/cli

Latest Docker for OSX (see docker info output below)

Very strange issue, it seems that the docker cp command is not working.

  1. Verify the file exists :
❯ docker run -ti foobar /bin/bash -c "ls -la /usr/lib/erlang/lib/gs-1.5.15.2/ebin/gstk_menuitem.beam"
-rw-r--r-- 1 root root 21444 Dec  5 11:46 /usr/lib/erlang/lib/gs-1.5.15.2/ebin/gstk_menuitem.beam
  1. Attempt to copy the file from the container to the host system
❯ docker cp foobar:/usr/lib/erlang/lib/gs-1.5.15.2/ebin/gstk_menuitem.beam ./gstk_menuitem.beam
Error: No such container:path: fooob:/usr/lib/erlang/lib/gs-1.5.15.2/ebin/gstk_menuitem.beam

Fail

Issue happens every time on multiple containers.

Tried on another container as well :

❯ docker cp riak-centos-7:2.2.5rc1:/usr/lib/erlang/lib/gs-1.5.15.2/ebin/gstk_menuitem.beam ./gstk_menuitem.beam
Error: No such container:path: riak-centos-7:2.2.5rc1:/usr/lib/erlang/lib/gs-1.5.15.2/ebin/gstk_menuitem.beam

I will reset the docker system, try again, and report back.

Output of docker version:

❯ docker version
Client:
 Version:       18.03.0-ce
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    0520e24
 Built: Wed Mar 21 23:06:22 2018
 OS/Arch:       darwin/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      18.03.0-ce
  API version:  1.37 (minimum version 1.12)
  Go version:   go1.9.4
  Git commit:   0520e24
  Built:        Wed Mar 21 23:14:32 2018
  OS/Arch:      linux/amd64
  Experimental: true

Output of docker info:

Containers: 141
 Running: 2
 Paused: 0
 Stopped: 139
Images: 312
Server Version: 18.03.0-ce
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 ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
 NodeID: u3z9bezqpglmqdl87dm7s66de
 Is Manager: true
 ClusterID: p4svyy8wbwfjwxwsxx1uwjm8k
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.65.3
 Manager Addresses:
  192.168.65.3:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.87-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: MYOU:4MSW:P5HT:C4RN:ROC7:NI3V:FIVF:DI7Z:5ITH:VCDF:RX3E:GKFX
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 54
 Goroutines: 168
 System Time: 2018-04-03T14:51:09.610509515Z
 EventsListeners: 2
HTTP Proxy: docker.for.mac.http.internal:3128
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

platfordesktop

Most helpful comment

Might improve usability if it specified the cause of the error i.e. you've tried to copy from an image, you can only copy from containers.

All 3 comments

Only works for containers, not images, strange limitation, but it is what it is. Closing issue.

Might improve usability if it specified the cause of the error i.e. you've tried to copy from an image, you can only copy from containers.

@bryanhuntesl I think the current behavior is reasonable: Containers are _instances_ of images. Images are stored as layers of diffs from the parent layer. So, I think, in order to see the filesystem of an 'image' (so that you can copy things), you would have to first spin it up as a container. I also agree that the error could be more informative.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loeffel-io picture loeffel-io  ·  4Comments

dnephin picture dnephin  ·  3Comments

mapio picture mapio  ·  4Comments

rcdailey picture rcdailey  ·  3Comments

dedalusj picture dedalusj  ·  3Comments