Move file from Docker container to Host system in Jenkins

I have configured Jenkins in Docker container. I am able to take a build. After a build I want to move WAR file into my Tomcat server which is running in host system. I have added copy command in post build task. Jenkins is not able to move the WAR to host system , since it is running in container.

How to move WAR file from container to Host system ?

  • pip cannot install websocket-server python packge
  • What is the docker.sock equivalent on Windows 10?
  • How to make my docker run on a specified linux kernel version?
  • webpack and react jsx - hot loading not working with docker container
  • LXC-Docker fails on dependencies
  • I couldn't run container which one I created from live OS
  • Host path : /home/test/tomcat/webapps

    Jenkins container path: /var/jenkins/workspace/dev/welcome/target/welcome.war

  • Is it possible to organize cluster of docker machines in local network to improve resource utilization?
  • Use of container docker as a proxy for CF app to get public IP
  • Laradock + Webpack + Hot-reload
  • Rename Ethernet Adapter In Docker windowsservercore Image
  • Dockerfile ADD https://zzzz x509: certificate signed by unknown authority
  • MySQL container failing to run initialisation scripts in Docker Compose
  • One Solution collect form web for “Move file from Docker container to Host system in Jenkins”

    I would create a volumne when starting jenkins with docker and then copy the war file there with a normal shell jenkins command. I usually do
    docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 -p 50000:50000 -v /home/docker:/var/jenkins_home --net="host" --env JAVA_OPS="-Xms1024m -Xmx1024m" --privileged=true axltxl/jenkins-dood

    The -v option is to create a volumne, which is a shared folder for container and host. In my case I use that for having the jenkins configuration outside docker container.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.