append_spec_file_to_docker_file and append_build_require_to_docker_file, refactored and tested