[JIRA] (JENKINS-61743) Customizable workspace and working directory of docker.images.inside()

2 views
Skip to first unread message

martrich89@web.de (JIRA)

unread,
Mar 30, 2020, 3:20:03 PM3/30/20
to jenkinsc...@googlegroups.com
Mart Rich created an issue
 
Jenkins / New Feature JENKINS-61743
Customizable workspace and working directory of docker.images.inside()
Issue Type: New Feature New Feature
Assignee: Unassigned
Attachments: example.txt, proposal.txt
Components: docker-workflow-plugin
Created: 2020-03-30 15:19
Priority: Major Major
Reporter: Mart Rich

Hello,

I want to have a possibility to change the "workdir" & "volume" destination directory within the image which will be started by the "docker.image.inside"-command.

The current problem is that the path to the mount-destination within the container and the working directory are hard-coded:
Hard-coded volumes:

Hard-coded Work-Dir (parameter 4 is always "ws" == "workspace"):

So the "default" image.inside command (on windows) results in something like:

docker run -t -d -w ${WORKSPACE} -v ${WORKSPACE}:${WORKSPACE} -v ${WORKSPACE}@tmp:${WORKSPACE}@tmp

It's not "clean" because the destination in the started container is hardcoded as the same directory of the workspace. This can cause issues with rights, existing drives, and other stuff.

Feature-Request in short:
I want to have the possibility to change the working directory and the volume mounting directory which points into the started container.

  • The default behavior can be kept as it is

I have two proposals (from the user side of view) attached in (proposal.txt)

 

 

Background how I ran into this:
My System is a Jenkins-Master on a Linux-Server. I have two Slaves one Linux & one Windows.

  • all this are real physical machines, no VM's or other stuff
  • The Windows-Slave has a Windows-Server 2016 OS

In my case the "workspace" of Jenkins is on the "E"-Drive.
If you run the attached "example.txt" you can reproduce the error on every jenkins

  • of course on my machine, dont need the "ws(...)" part

The Error is an error on the docker run command because docker is unable to create a new Drive, as mounting point in the created container.

  • I tried very much to create a "E"-Drive as volume in the Image, but I wasn't able to make it
    • I tried symlinks, registry changes and stuff ...
  • after all this I looked into the Code of the Plugin and thought this should be changeable ...

All in all I think the origin of the problem are the hard-coded directories within the containers.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

martrich89@web.de (JIRA)

unread,
Mar 30, 2020, 4:58:04 PM3/30/20
to jenkinsc...@googlegroups.com

martrich89@web.de (JIRA)

unread,
Mar 30, 2020, 4:58:05 PM3/30/20
to jenkinsc...@googlegroups.com

martrich89@web.de (JIRA)

unread,
Apr 6, 2020, 7:37:02 AM4/6/20
to jenkinsc...@googlegroups.com
tharilya updated an issue
Change By: tharilya
Environment: Jenkins: 2.190.1
docker-workflow-plugin: 1.23
Linux-Machine (2-Cores - Master, others for Linux-Slave):
Linux 3.10.0-1062.12.1.e17.x86_x64 GNU/Linux
Windows-Machine:
OS Name: Microsoft Windows Server 2016 Datacenter
OS Version: 10.0.14393 N/A Build 14393

martrich89@web.de (JIRA)

unread,
Apr 6, 2020, 7:37:02 AM4/6/20
to jenkinsc...@googlegroups.com
tharilya updated an issue
Change By: tharilya
Environment: Jenkins: 2.190.1 \n
docker-workflow-plugin: 1.23
Linux-Machine (2-Cores - Master, others for Linux-Slave):
Linux 3.10.0-1062.12.1.e17.x86_x64 GNU/Linux
Windows-Machine:
OS Name: Microsoft Windows Server 2016 Datacenter
OS Version: 10.0.14393 N/A Build 14393

martrich89@web.de (JIRA)

unread,
Apr 6, 2020, 7:38:02 AM4/6/20
to jenkinsc...@googlegroups.com
tharilya updated an issue
Change By: tharilya
Environment: Jenkins: 2.190.1 \n <br>
docker-workflow-plugin: 1.23
Linux-Machine (2-Cores - Master, others for Linux-Slave):
Linux 3.10.0-1062.12.1.e17.x86_x64 GNU/Linux
Windows-Machine:
OS Name: Microsoft Windows Server 2016 Datacenter
OS Version: 10.0.14393 N/A Build 14393

martrich89@web.de (JIRA)

unread,
Apr 6, 2020, 7:38:02 AM4/6/20
to jenkinsc...@googlegroups.com
tharilya updated an issue
Change By: tharilya
Environment: Jenkins: 2.190.1 <br>
docker-workflow-plugin: 1.23
Linux-Machine (2-Cores - Master, others for Linux-Slave):
Linux 3.10.0-1062.12.1.e17.x86_x64 GNU/Linux
Windows-Machine:
OS Name: Microsoft Windows Server 2016 Datacenter
OS Version: 10.0.14393 N/A Build 14393

martrich89@web.de (JIRA)

unread,
Apr 29, 2020, 6:45:02 AM4/29/20
to jenkinsc...@googlegroups.com
tharilya updated an issue
Hello,

I want to have a possibility to change the "workdir" & "volume" destination directory within the image which will be started by the "docker.image.inside"-command.

The current problem is that the path to the mount-destination within the container and the working directory are hard-coded:
Hard-coded volumes:


Hard-coded Work-Dir (parameter 4 is always "ws" == "workspace"):


So the "default" image.inside command (on windows) results in something like:
{code:java}

docker run -t -d -w ${WORKSPACE} -v ${WORKSPACE}:${WORKSPACE} -v ${WORKSPACE}@tmp:${WORKSPACE}@tmp
{code}

It's not "clean" because the destination in the started container is hardcoded as the same directory of the workspace. This can cause issues with rights, existing drives, and other stuff.

Feature-Request in short:
I want to have the possibility to change the working directory and the volume mounting directory which points into the started container.
* The default behavior can be kept as it is


I have two proposals (from the user side of view) attached in (proposal.txt)

  It would be nice to make the "image.inside" command will result in something like this:
{code:java}
docker run -t -d -w ${IMG_WORK_DIR} -v ${HOST_WORKSPACE}:${IMG_WORKSPACE} -v ${HOST_WORKSPACE}@tmp:${IMG_WORKSPACE}@tmp
{code}
   

Background how I ran into this:
My System is a Jenkins-Master on a Linux-Server. I have two Slaves one Linux & one Windows.
* all this are real physical machines, no VM's or other stuff
* The Windows-Slave has a Windows-Server 2016 OS


In my case the "workspace" of Jenkins is on the "E"-Drive.
If you run the attached "example.txt" you can reproduce the error on every jenkins
* of course on my machine, dont need the "ws(...)" part


The Error is an error on the docker run command because docker is unable to create a new Drive, as mounting point in the created container.
* I tried very much to create a "E"-Drive as volume in the Image, but I wasn't able to make it
** I tried symlinks, registry changes and stuff ...
* after all this I looked into the Code of the Plugin and thought this should be changeable ...


All in all I think the origin of the problem are the hard-coded directories within the containers.

martrich89@web.de (JIRA)

unread,
Apr 29, 2020, 6:52:02 AM4/29/20
to jenkinsc...@googlegroups.com

martrich89@web.de (JIRA)

unread,
Apr 29, 2020, 6:52:03 AM4/29/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages