I was reading this questions How to copy files from host to Docker container?, Docker: Copying files from Docker container to host, and How to mount a host directory in a Docker container
Suppose those files are in Host
Directory: /home/user_host/
FileInHostOnly.zip
FileInHostAndContainer_1.zip suppose 15M, 2020/06/09 <- Older compared with Container
FileInHostAndContainer_2.zip suppose 15M, 2021/01/09 <- Newer compared with Container
Suppose those files are in Container
Directory: /home/user_cont/
FileInContainerOnly.zip
FileInHostAndContainer_1.zip suppose 12M, 2021/01/09 <- Newer compared with Host
FileInHostAndContainer_2.zip suppose 12M, 2019/12/09 <- Older compared with Host
Now the container starts..
docker run -v /home/user_host/:/home/user_cont/ --name myContainer the_image
- How must solve the conflict?
- After the myContainer finished, what would be the final result in the Host?
EDIT 1 (according to David-Maze response)
Merging in the directory context, some files are replaced others remains equal... At the Container and the Host will appear something like:
FileInHostOnly.zip,
FileInContainerOnly.zip
FileInHostAndContainer_1.zip suppose 15M, 2020/06/09
FileInHostAndContainer_2.zip suppose 15M, 2021/01/09