Re: Can't run shell script in docker container

2021-09-03 Thread 'Björn Pedersen' via Jenkins Users
How are you starting the container and run the script?  From the locations 
it looks like  a sh step in a pipeline. 
Then you should  not mount jenkins_home or temp that way.  
Instead use a docker.image.inside step to  run the script. It will  do the  
correct mounting. 
(/tmp should mount /var/jenkins_home/workspace/Production/Test2@tmp, not 
the host tmp ,and the container should also mount
the workspace ( /var/jenkins_home/workspace/Production/Test2[@n]) only, not 
the full jenkins home.)

jerome.god...@gmail.com schrieb am Donnerstag, 2. September 2021 um 
15:18:02 UTC+2:

> Are you sure the mount of tmp did work and not superseed by another 
> default mount there?
>
> Maybe try to touch a new file from the docker and see if it show up into 
> the original tmp folder. If so, it mean you might have permission problems 
> instead. Make sure to allow rw for everyone on the file before.
>
> On Thursday, September 2, 2021 at 7:18:50 AM UTC-4 il...@icandeliver.ru 
> wrote:
>
>> Good day!
>>
>> I am trying to run a shell script in a docker container.  The script is 
>> created on the host in the folder: 
>> */var/jenkins_home/workspace/Production/Test2@tmp*
>>
>> The container by default is starts with the following volumes:
>> *--volume /var/jenkins_home:/var/jenkins_home:rw --volume /tmp:/tmp:rw*
>>
>> But it is launched in the container from the folder:
>>
>> */bin/sh: can't open '/tmp/jenkins15846770116304196347.sh': No such file 
>> or directory Build step 'Execute shell' marked build as failure*
>>
>> How to fix that issue?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5e6ab623-88eb-4841-a7f5-e474515cde54n%40googlegroups.com.


Re: Can't run shell script in docker container

2021-09-02 Thread Jerome Godbout


Are you sure the mount of tmp did work and not superseed by another default 
mount there?

Maybe try to touch a new file from the docker and see if it show up into 
the original tmp folder. If so, it mean you might have permission problems 
instead. Make sure to allow rw for everyone on the file before.

On Thursday, September 2, 2021 at 7:18:50 AM UTC-4 il...@icandeliver.ru 
wrote:

> Good day!
>
> I am trying to run a shell script in a docker container.  The script is 
> created on the host in the folder: 
> */var/jenkins_home/workspace/Production/Test2@tmp*
>
> The container by default is starts with the following volumes:
> *--volume /var/jenkins_home:/var/jenkins_home:rw --volume /tmp:/tmp:rw*
>
> But it is launched in the container from the folder:
>
> */bin/sh: can't open '/tmp/jenkins15846770116304196347.sh': No such file 
> or directory Build step 'Execute shell' marked build as failure*
>
> How to fix that issue?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b4966eea-f1d1-40d1-b2c2-4ea84f3aa6a3n%40googlegroups.com.


Can't run shell script in docker container

2021-09-02 Thread Илья Скорик
Good day!

I am trying to run a shell script in a docker container.  The script is 
created on the host in the folder: 
*/var/jenkins_home/workspace/Production/Test2@tmp*

The container by default is starts with the following volumes:
*--volume /var/jenkins_home:/var/jenkins_home:rw --volume /tmp:/tmp:rw*

But it is launched in the container from the folder:

*/bin/sh: can't open '/tmp/jenkins15846770116304196347.sh': No such file or 
directory Build step 'Execute shell' marked build as failure*

How to fix that issue?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/100f7957-b7b1-43b7-b91e-720ae8693030n%40googlegroups.com.