How to copy files from host to Docker container?

前端 未结 30 3105
南方客
南方客 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:17

    I tried most of the (upvoted) solutions here but in docker 17.09 (in 2018) there is no longer /var/lib/docker/aufs folder.

    This simple docker cp solved this task.

    docker cp c:\path\to\local\file container_name:/path/to/target/dir/
    

    How to get container_name?

     docker ps 
    

    There is a NAMES section. Don't use aIMAGE.

提交回复
热议问题