Skip to content

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

Description

@wxl374

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions