docker copy file from container to host, from host to container on windows

  1. xshell connect to 192.168.99.100      user: docker    pass:tcuser
  2. docker ps     find the container id
  3. (from container to host)  docker cp containerId:/usr/elasticsearch.tar.gz /usr
  4. (from host to container)    docker exec -i 6c3d52a9763b bash -c ‘cat > /tmp/elasltic.tar’ < /usr/elasticsearch-5.5.0.tar.gz                                                               docker exec -i containerId bash -c ‘cat > /tmp/elastic.tar’ < /usr/elasticsearch-5.5.0.tar.gz

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.