I can copy all files and folders from /var/www
in docker container with name container_name
to host folder /var/mybackup
with command
docker cp container_name:/var/www /var/mybackup
But problem i need to create exclusion of few folder which i don’t want to copy as example too "heavy" folders or sensitive information
2
Answers
I think it would be best to prepare your data first, and then copy it into the container.
docker cp
command.In general:
Dockerfile
). This way you can automate the process and store images in a container registry. Upgrading your webpage to a newer version would then only mean to exchange the image with a newer version./var/www
a shared host directory, so that you don’t need to copy data into the container, but just update it on the host machine.I would use bash to write a script to do that for me. In the script I would then specify the files and folders to exclude. Like in the example below, I have excluded files that exceed a certain size…