no var/jenkins_home folder

11 views
Skip to first unread message

Anil

unread,
Feb 3, 2021, 10:31:49 PM2/3/21
to Jenkins Users
running


docker run \
 -u jenkins \
 --rm \
 -d \
 -p 8080:8080 \
 -p 50000:50000 \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v /home/jenkins:/var/jenkins_home \
 jenkins/jenkins:lts 

because when I try to run the script in the tutorial, it fails.

+ /home/jenkins/scripts/fibonacci.sh 5 /var/jenkins_home/workspace/script@tmp/durable-14129c06/script.sh: 1: /var/jenkins_home/workspace/script@tmp/durable-14129c06/script.sh: /home/jenkins/scripts/fibonacci.sh: not found

There is no /var/jenkins_home folder

jenkins:~$ cd /var
jenkins:/var$ ls
backups  cache  crash  lib  local  lock  log  mail  opt  run  snap  spool  tmp

Capture.JPG

Anil

unread,
Feb 3, 2021, 10:32:57 PM2/3/21
to Jenkins Users
Jenkins 2.263.3 LTS Windows 10 Home Docker Windows Ubuntu

Anil

unread,
Feb 3, 2021, 11:27:34 PM2/3/21
to Jenkins Users
I am wondering - should I be running the jenkins scripts in the Docker Desktop CLI?
I noticed there  is a  CLI button and when I click it, I get a shell

#
# pwd
/
# whoami
root
# ls /var
backups  cache  jenkins_home  lib  local  lock  log  mail  opt  run  spool  tmp
# ls /var/jenkins_home
config.xml                           jenkins.telemetry.Correlator.xml  scripts                   users
copy_reference_file.log              jobs                              secret.key                war
hudson.model.UpdateCenter.xml        logs                              secret.key.not-so-secret  workflow-libs
hudson.plugins.git.GitTool.xml       nodeMonitors.xml                  secrets
identity.key.enc                     nodes                             updates
jenkins.install.UpgradeWizard.state  plugins                           userContent
#


But when I open a Windows Terminal and go to the ubuntu terminal, I see  nothing

There is no /var/jenkins_home folder

jenkins:~$ cd /var
jenkins:/var$ ls
backups  cache  crash  lib  local  lock  log  mail  opt  run  snap  spool  tmp

Anil

unread,
Feb 3, 2021, 11:36:39 PM2/3/21
to Jenkins Users
I tried again. It is very strange.  Now the script  works. I did not  do anything differently.


Started by user jenkins admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/script
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Deploy)
[Pipeline] timeout
Timeout set to expire in 1 min 0 sec
[Pipeline] {
[Pipeline] sh
+ /var/jenkins_home/scripts/fibonacci.sh 5
The Fibonacci series is : 
0
1
1
2
3
[Pipeline] }
[Pipeline] // timeout
[Pipeline] timeout
Timeout set to expire in 1 min 0 sec
[Pipeline] {
[Pipeline] sh
+ /var/jenkins_home/scripts/fibonacci.sh 32
The Fibonacci series is : 
0
1
1
2
3
5
8
13
21
34
55
89
144
233
Reply all
Reply to author
Forward
0 new messages