WurmD
WurmD

Reputation: 1483

docker cp remotely (from container to host)

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..

Any suggestions?

Upvotes: 0

Views: 1151

Answers (1)

Tarun Lalwani
Tarun Lalwani

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

Related Questions