从容器往host拷贝
docker cp <containerId>:/file/path/within/container /host/path/target
从host拷贝到容器
docker cp foo.txt mycontainer:/foo.txt
或者
docker exec -it <container_id> bash -c 'cat > /path/to/container/file' < /path/to/host/file/
或者
docker ps
docker inspect -f '{{.Id}}' SHORT_CONTAINER_ID-or-CONTAINER_NAME
sudo cp path-file-host /var/lib/docker/aufs/mnt/FULL_CONTAINER_ID/PATH-NEW-FILE
kubectl
kubectl get pods --namespace=demo | grep myapp
kubectl exec -i myapp-kp1by --namespace=demo -- /bin/bash -c 'cat /gc.log.0.current' > myapp.gc