How to copy files from host to Docker container?

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

    In a docker environment, all containers are found in the directory:

    /var/lib/docker/aufs/required-docker-id/

    To copy the source directory/file to any part of the container, type the given command:

    sudo cp -r mydir/ /var/lib/docker/aufs/mnt/required-docker-id/mnt/

提交回复
热议问题