I have a Docker image running on a VM instance, which is running in GCE (Google Cloud Engine). To extract files from the Docker image to local machine, I usually do
docker cp <DOCKER_IMG>:/root/<PATH_IN_IMG> /home/<PATH_IN_VM>
gcloud compute scp --recurse <VM_INSTANCE_NAME>:/home/<PATH_IN_VM> ~/Desktop/<LOCAL_MACHINE_PATH>
So, the files follow the path DOCKER_IMAGE -> GCE VM -> LOCAL MACHINE.
But now I have run out of space in VM and cannot add more due to free trial limitations.
Is there a way to do the copy directly DOCKER_IMAGE -> LOCAL MACHINE, without taking up space in GCE Linux VM in the meanwhile?
Any other alternative is welcome, for example copying the files DOCKER_IMAGE -> GCE VM and deleting the copied ones so that the duplicated files do not take the space in the VM environment as well as in the Docker image (docker cp and rm after cp of each one of the files).