I installed Jenkins using below command

sudo docker run  -u root     -d   -p 8081:8081   -p 50001:50001   -v /data/jenkins-data:/var/jenkins_home   -v /var/run/docker.sock:/var/run/docker.sock   a6017fd28a8c

Now I copied git and chrome driver to /data/jenkins-data and is now available inside the container

  sudo docker cp /usr/local/bin/chromedriver d999d6e91cad:/var/jenkins_home/jobs/
  sudo docker exec -it d999d6e91cad bash

But when I try to execute these executables from inside docker, it says "No such file or Directory"

    bash-4.4# /var/jenkins_home/jobs/chromedriver
    bash: /var/jenkins_home/jobs/chromedriver: No such file or directory

What am I missing?

  • 1
    Is it the same container instance or is it a new container (the $HOSTNAME in the container is its Docker id). If you need files in a container it is always best to include them in an image build (I.e. proper Dockerfile). That makes them available in all instances created from the image. – xenoid Mar 18 '19 at 10:33
  • Same Docker Container – Zama Ques Mar 18 '19 at 11:02
  • Possibly an access rights problem... Is Jenkins running as root or as some Jenkins user? What are the access flags on the file(and all its parent directories)? – xenoid Mar 18 '19 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.