Home > Software design >  Copy folder from Dockerfile to CI-Host machine during building of the Image
Copy folder from Dockerfile to CI-Host machine during building of the Image

Time:03-26

I build an Image with a Dockerfile in Jenkins. In the Dockerfile ./gradlew build is run which generates .xml-files for the JUnit Test-results.

I want to copy these files into the Jenkins which ran docker build so that the Jenkins UI can display the results.

How would I do that?

There are no containers yet so docker cp or volumes are not options afaik.

CodePudding user response:

You can create a container without starting it, then you can copy from it:

docker create --name tmp_container ci_image
docker cp tmp_container:/source ./destination
docker rm tmp_container

Documentation: docker create.

  • Related