File metadata should be preserved when the build context directory is created. The easiest way to accomplish this would be to add a preserve flag to the fileutils cp and cpr functions, to behave the same as cp -p, and then to utilize the flag when creating the context.
In order to work around this: https://github.com/docker/docker/issues/3556
File metadata should be preserved when the build context directory is created. The easiest way to accomplish this would be to add a preserve flag to the fileutils cp and cpr functions, to behave the same as cp -p, and then to utilize the flag when creating the context.