Copy files from host to Docker container and vice versa

Docker command to copy/update the files from host to container

   Command: 
   docker cp LOCALFILE_WITH_PATH CONTAINER_NAME:DEST_PATH
   Example: 
   docker cp config.xml CONTAINER_NAME:/opt/app/config.xml

Docker command to copy the files from container to local host

   Command:
   docker cp CONTAINER_NAME:SOURCE_PATH LOCALDIRPATH
   Example:
   docker cp CONTAINER_NAME:/opt/app/config.xml .

Replace the CONTAINER_NAME appropriately

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s