Jobs: Run Docker Container (OD-2282)
Vasiliy Kulikov opened 11 months ago

User case

I want to get the build version using the gitversion docker image.

I'm trying to run a docker container using the following command:

/repo -showvariable MajorMinorPatch > version.txt

and it doesn't work. I couldn't find "version.txt" file in Job Workspace. изображение.png

изображение_2.png

Opposite, if i run a container in local environment, then i get version.txt file in a local file system.

изображение_3.png

What I tried

/repo -showvariable MajorMinorPatch @@> version.txt@@
/repo -showvariable MajorMinorPatch @@> version.txt
/repo -showvariable MajorMinorPatch "> version.txt"
/repo -showvariable MajorMinorPatch "> $ONEDEV_WORKSPACE/version.txt"
  • Robin Shen commented 11 months ago

    Input ouput redirection for docker container is not supported as it can read/write files into host file systems and can impose security issues in OneDev. Please use a command step to run relevant commands inside the gittools/gitversion image to redirect output.

  • Vasiliy Kulikov commented 11 months ago

    Thank you for your response.

  • Vasiliy Kulikov changed state to 'Closed' 11 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2282
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover