How to copy files from host to Docker container?

前端 未结 30 2952
南方客
南方客 2020-11-22 06:58

I am trying to build a backup and restore solution for the Docker containers that we work with.

I have Docker base image that I have created, ubuntu:base

30条回答
  •  一个人的身影
    2020-11-22 07:14

    This is the command to copy data from Docker to Host:

    docker cp container_id:file path/filename /hostpath
    
    docker cp a13fb9c9e674:/tmp/dgController.log /tmp/
    

    Below is the command to copy data from host to docker:

    docker cp a.txt ccfbeb35116b:/home/
    

提交回复
热议问题