Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work when docker run cmd args contain single quotes #111

Open
wxl374 opened this issue Apr 10, 2023 · 0 comments
Open

doesn't work when docker run cmd args contain single quotes #111

wxl374 opened this issue Apr 10, 2023 · 0 comments

Comments

@wxl374
Copy link

wxl374 commented Apr 10, 2023

docker inspect:

[
    {
        "Id": "*****",
        "Created": "2017-03-21T07:43:54.073781336Z",
        "Path": "/bin/sh",
        "Args": [
            "-c",
            "java   -Dnexus-work=${SONATYPE_WORK} -Dnexus-webapp-context-path=${CONTEXT_PATH}   -Xms${MIN_HEAP} -Xmx${MAX_HEAP}   -cp 'conf/:lib/*'   ${JAVA_OPTS}   org.sonatype.nexus.bootstrap.Launcher ${LAUNCHER_CONF}"
        ],
......

running runlike get:

docker run ***** /bin/sh -c 'java -Dnexus-work=${SONATYPE_WORK} -Dnexus-webapp-context-path=${CONTEXT_PATH} -Xms${MIN_HEAP} -Xmx${MAX_HEAP} -cp \'conf/:lib/*\' ${JAVA_OPTS} org.sonatype.nexus.bootstrap.Launcher ${LAUNCHER_CONF}'

but single quote cannot inside single quotes
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Single-Quotes

use '"'"' instead of \' worked
https://stackoverflow.com/questions/1250079/how-to-escape-single-quotes-within-single-quoted-strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant