refactor code copy to support all versions of docker