FROM ${buildRegistry}/build/python:2.7-${arch}-0.8.2 as build-system COPY ${modules_requirements_file} /app/${modules_requirements_file} FROM build-system as intermediate # add credentials on build COPY id_github_jenkins /root/.ssh/id_rsa RUN ssh-keyscan github.com >> /root/.ssh/known_hosts && \ chmod -R 600 /root/.ssh/ # temp-package python dependencies RUN pip download -r /app/requirements.txt -d /temp-package/python ### create the runtime image ### FROM build-system as runtime # install temp-packageed python dependencies COPY --from=intermediate /temp-package/python /temp-package/python RUN pip install /temp-package/python/* && \ rm -rf /temp-package WORKDIR /app COPY ./ /app/ <% if (copy_file) { print "COPY copied_files/* $copy_target"} %> <% add_files.each { print "COPY ${it.path} ${it.target}\n" } %> ENTRYPOINT ["/entrypoint.sh"]