I have a docker container running Jenkins on a server. I'm trying to get code from GitHub and copy the contents to the target directory from the Jenkins pipeline.
My repository is cloned here: /var/jenkins_home/workspace/my-repo
My target directory is: /home/deploy/project
This is my cp command: cp -r . /home/deploy/peatio
This is the error statement: cp: cannot create directory '/home/deploy/peatio': No such file or directory
UPDATE: I installed Jenkins without Docker and my use case worked fine. It was due to running Jenkins in Docker container. So, the question is, how can we copy something from Docker container to local host by running copy command inside the Docker container? Is this even possible? I'm aware of docker cp
and it is used outside Docker container.