jenkinsci / docker

Docker official jenkins repo
https://hub.docker.com/r/jenkins/jenkins
MIT License
6.63k stars 4.51k forks source link

Error passing JAVA_OPTS with spaces and quotes #213

Closed F1ashhimself closed 8 years ago

F1ashhimself commented 8 years ago

According to http://wiki.qatools.ru/display/AL/Allure+Jenkins+Plugin#AllureJenkinsPlugin-configure-securityConfigureJenkinsContentSecurity

I should use something like docker run -v ~/jenkins_home:/var/jenkins_home -p 80:8080 -p 50000:50000 -d --restart=always --env JAVA_OPTS=-Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';" jenkins to get allure plugin working.

But when I'm running this command without -d (detached) flag I can see the issue Error: Could not find or load main class 'self';.

This is related to #185 #194 #202 1.5 month already passed, are you going to fix this?

carlossg commented 8 years ago

have you pulled last version 1.642.2 ?

F1ashhimself commented 8 years ago

Sure, this appears on latest, 1.642.2 (Dockerfile).

carlossg commented 8 years ago

I have added tests for JAVA_OPTS, JENKINS_OPTS and arguments. As it is now JAVA_OPTS with spaces and quotes is broken. If I revert 5fc9cd06a5adb213cebfe3fcfc9113578f0fc43d to use bash -c again, it all works except arguments

Unless somebody with more bash fu can find a solution that works in all cases I'll revert 5fc9cd06a5adb213cebfe3fcfc9113578f0fc43d and add a note that args are broken

F1ashhimself commented 8 years ago

Unless somebody with more bash fu can find a solution that works in all cases I'll revert 5fc9cd0 and add a note that args are broken

Seems ok as for now, will try to find a solution.

carlossg commented 8 years ago

btw to run the tests just use bats tests (brew install bats in os x)

carlossg commented 8 years ago

fixed now, will publish a new image

F1ashhimself commented 8 years ago

@carlossg thank you

kalahari commented 8 years ago

This appears to be broken again in docker pull jenkinsci/jenkins:2.4 but I don't see a corresponding release in this project so I'm not sure where it broke. Was working fine in docker pull jenkinsci/jenkins:2.0-beta-1

cuipengfei commented 7 years ago

same problem with 2.19.1

carlossg commented 7 years ago

there is a test passing, https://github.com/jenkinsci/docker/blob/master/tests/runtime.bats#L33 so what exactly is broken for you?