Reputation: 1483
I'm attempting to create a Jenkins job that remotely runs "docker cp" to copy a folder from the running container to the host machine.
Currently I have
docker run --rm docker:1.7.1 docker -H stuff.dev.blah.com:5000 cp cc_head:/opt/blah/build/cc_head/games /home/devadmin/games
But that doesn't work..
So, the machine host is stuff.dev.blah.com, and I can ssh to it with ssh [email protected]
and at the host machine docker cp cc_head:/opt/blah/build/cc_head/games /home/devadmin/games
works
All we can have here is docker 1.7.1, but if you manage to do this with a newer version I'd also be happy
the running container is called cc_head
Any suggestions?
Upvotes: 0
Views: 1151
Reputation: 146630
You have two options
Mount the folder in cc_head container
Where you run the container cc_head and add -v /home/devadmin/games:/somefolder
while running the same
docker run --rm docker:1.7.1 docker -H stuff.dev.blah.com:5000 cp cc_head:/opt/blah/build/cc_head/games cc_head:/somefolder
Mount the folder in separate container
Run another container on the host and map the /home/devadmin/games
and use that for the copy operation
docker run --rm docker:1.7.1 docker -H stuff.dev.blah.com:5000 cp cc_head:/opt/blah/build/cc_head/games container:/somefolder
Upvotes: 1