Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32010

Container start command option - Argument parsing

XMLWordPrintable

      This bug concerns container start commands with one or more command line options.

      If a container is run from command line like :

      docker run -it <image_hash> "tail -n 20 /etc/passwd"
      

      the "tail -n 20 /etc/passwd" command is interpreted as:

          "Path": "/bin/sh",
          "Args": [
              "-c",
              "tail -n 20 /etc/passwd"
          ],
      

      However if I add the same command without quotes in "Container start command" option it is interpreted as :

          "Path": "/bin/sh",
          "Args": [
              "-c",
              "tail",
              "-n",
              "20",
              "/etc/passwd"
          ],
      

      If I enclose the command in single or double quotes the problem remains since the command is interpreted as (example using single quotes) :

          "Path": "/bin/sh",
          "Args": [
              "-c",
              "'tail",
              "-n",
              "20",
              "/etc/passwd'"
          ],
      

      Both cases result in errors and the container does not start. I searched through the documentation but there are no recommendations regarding this option.

            Unassigned Unassigned
            zubu Paris Zoumpouloglou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: