How to copy file from cloudera quickstart docker to local file system ( mac or windows )

 

  1. Ensure you quickstart docker vm is running ( you can check by using below command)
    https://hub.docker.com/r/cloudera/quickstart/

Launch VM container ( Go to terminal and run )

docker run –hostname=quickstart.cloudera –privileged=true -t -i -v            /Users/navnit/Documents/cloudera:/src –publish-all=true -p 8888 cloudera/quickstart /usr/bin/docker-quickstart
2. Run docker ps command to validate if cloudera/quickstart is running
ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                     NAMES
0cd3684048c4        cloudera/quickstart   “/usr/bin/docker-qui…”   8 minutes ago                     Up 8 minutes        0.0.0.0:32768->8888/tcp   romantic_einstein
3. Copy file from hdfs to docker directory

hdfs dfs -copyToLocal /user/cloudera/retail_db_txt /root/

Note – /root here is docker directory

  1. use docker cp command to copy from cloudera/quickstart to local file system ( mac or windows )
    lmnshuk055607:~ $ docker cp –help

Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
docker cp dreamy_pasteur:/root/retail_db_txt /Users/navnit/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s