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

docker.image('my-image').inside{...} no longer honors Dockerfile "entrypoint" since version 1.8

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: docker-workflow-plugin
    • Labels:
      None
    • Environment:
      docker-pipeline-plugin:1.9.1
      Jenkins 2.19.4.2
    • Similar Issues:

      Description

      The docker pipeline plugin used to honor the Dockerfile "entrypoint" until v1.8 in "docker.image('my-image').inside{...}". Since then, "entrypoint" is ignored.

      The capability to do selenium tests with a selenium-standalone-server running inside the Docker container fails since 1.8.

      This regression seems to be caused by JENKINS-37987 and the github commit "[FIXED JENKINS-37987] Override ENTRYPOINT, not just command, for WithContainerStep".

      This Jira seem to be similar to JENKINS-39748

      Testcase

      Code

      node ("docker") {
          docker.image('cloudbees/java-build-tools:2.0.0').inside {
      
              // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
              sh "curl http://127.0.0.1:4444/wd/hub"
              
              // test with selenium python
              writeFile (
                  file: 'selenium_remote_web_driver_test.python', 
                  text: 
      """#!/usr/bin/env python 
      
      from selenium import webdriver
      from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
      
      driver = webdriver.Remote(
         command_executor='http://127.0.0.1:4444/wd/hub',
         desired_capabilities=DesiredCapabilities.FIREFOX)
      
      driver.get('http://python.org')
      assert 'Python' in driver.title
      """)
      
              sh "python selenium_remote_web_driver_test.python"
      
          }
      }
      

      Console

      The check "curl http://127.0.0.1:4444/wd/hub" will fail.

      Started by user admin
      [Pipeline] node
      Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
      [Pipeline] {
      [Pipeline] sh
      [testSelenium2] Running shell script
      + docker inspect -f . cloudbees/java-build-tools:2.0.0
      .
      [Pipeline] withDockerContainer
      $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
      [Pipeline] {
      [Pipeline] sh
      [testSelenium2] Running shell script
      + curl http://127.0.0.1:4444/wd/hub
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused
      [Pipeline] }
      $ docker stop --time=1 c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
      $ docker rm -f c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code 7
      Finished: FAILURE
      

      Workaround

      The workaround is to manually start the Dockerfile entrypoint with sh "nohup /opt/bin/entry_point.sh &".

      Code

      node ("docker") {
          docker.image('cloudbees/java-build-tools:2.0.0').inside {
              // WORKAROUND: MANUALLY START THE DOCKERFILE ENTRYPOINT
              sh "nohup /opt/bin/entry_point.sh &"
              sh "sleep 5"
              
              // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
              sh "curl http://127.0.0.1:4444/wd/hub"
              
              // test with selenium python
              writeFile (
                  file: 'selenium_remote_web_driver_test.python', 
                  text: 
      """#!/usr/bin/env python 
      
      from selenium import webdriver
      from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
      
      driver = webdriver.Remote(
         command_executor='http://127.0.0.1:4444/wd/hub',
         desired_capabilities=DesiredCapabilities.FIREFOX)
      
      driver.get('http://python.org')
      assert 'Python' in driver.title
      """)
      
              sh "python selenium_remote_web_driver_test.python"
      
          }
      }
      

      Console

      Started by user admin
      [Pipeline] node
      Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
      [Pipeline] {
      [Pipeline] sh
      [testSelenium2] Running shell script
      + docker inspect -f . cloudbees/java-build-tools:2.0.0
      .
      [Pipeline] withDockerContainer
      $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
      [Pipeline] {
      [Pipeline] sh
      [testSelenium2] Running shell script
      + nohup /opt/bin/entry_point.sh
      [Pipeline] sh
      [testSelenium2] Running shell script
      + sleep 5
      [Pipeline] sh
      [testSelenium2] Running shell script
      + curl http://127.0.0.1:4444/wd/hub
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      [Pipeline] writeFile
      [Pipeline] sh
      [testSelenium2] Running shell script
      + python selenium_remote_web_driver_test.python
      [Pipeline] }
      $ docker stop --time=1 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
      $ docker rm -f 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

        Attachments

          Issue Links

            Activity

            cleclerc Cyrille Le Clerc created issue -
            cleclerc Cyrille Le Clerc made changes -
            Field Original Value New Value
            Summary Dockerfile "entrypoint" no longer honored by docker-pipeline:1.8 docker.image('my-image').inside{...} no longer honors Dockerfile "entrypoint" since version 1.8
            cleclerc Cyrille Le Clerc made changes -
            Description The docker pipeline plugin used to honor the Dockerfile "entrypoint" until v1.8. Since then, "entrypoint" is ignored and the capability to do selenium tests fails.


            This regression seems to be caused by JENKINS-37987 and the github commit [\[FIXED JENKINS-37987\] Override ENTRYPOINT, not just command, for WithContainerStep|https://github.com/jenkinsci/docker-workflow-plugin/commit/5b0586d6bd87fc4f108693ee9361252a24eb37d1]

            This Jira seem to be similar to JENKINS-39748

            h3. Testcase

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {

                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            The check "{{curl http://127.0.0.1:4444/wd/hub}}" will fail.

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused
            [Pipeline] }
            $ docker stop --time=1 c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            $ docker rm -f c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 7
            Finished: FAILURE
            {noformat}

            h3. Workaround

            The workaround is to manually start the Dockerfile entrypoint with {{sh "nohup /opt/bin/entry_point.sh &"}}.

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {
                    // WORKAROUND: MANUALLY START THE DOCKERFILE ENTRYPOINT
                    sh "nohup /opt/bin/entry_point.sh &"
                    sh "sleep 5"
                    
                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + nohup /opt/bin/entry_point.sh
            [Pipeline] sh
            [testSelenium2] Running shell script
            + sleep 5
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
            [Pipeline] writeFile
            [Pipeline] sh
            [testSelenium2] Running shell script
            + python selenium_remote_web_driver_test.python
            [Pipeline] }
            $ docker stop --time=1 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            $ docker rm -f 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            {noformat}
            The docker pipeline plugin used to honor the Dockerfile "entrypoint" until v1.8 in {{docker.image('my-image').inside\{...\}}}. Since then, "entrypoint" is ignored and the capability to do selenium tests fails.


            This regression seems to be caused by JENKINS-37987 and the github commit [\[FIXED JENKINS-37987\] Override ENTRYPOINT, not just command, for WithContainerStep|https://github.com/jenkinsci/docker-workflow-plugin/commit/5b0586d6bd87fc4f108693ee9361252a24eb37d1]

            This Jira seem to be similar to JENKINS-39748

            h3. Testcase

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {

                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            The check "{{curl http://127.0.0.1:4444/wd/hub}}" will fail.

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused
            [Pipeline] }
            $ docker stop --time=1 c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            $ docker rm -f c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 7
            Finished: FAILURE
            {noformat}

            h3. Workaround

            The workaround is to manually start the Dockerfile entrypoint with {{sh "nohup /opt/bin/entry_point.sh &"}}.

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {
                    // WORKAROUND: MANUALLY START THE DOCKERFILE ENTRYPOINT
                    sh "nohup /opt/bin/entry_point.sh &"
                    sh "sleep 5"
                    
                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + nohup /opt/bin/entry_point.sh
            [Pipeline] sh
            [testSelenium2] Running shell script
            + sleep 5
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
            [Pipeline] writeFile
            [Pipeline] sh
            [testSelenium2] Running shell script
            + python selenium_remote_web_driver_test.python
            [Pipeline] }
            $ docker stop --time=1 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            $ docker rm -f 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            {noformat}
            cleclerc Cyrille Le Clerc made changes -
            Description The docker pipeline plugin used to honor the Dockerfile "entrypoint" until v1.8 in {{docker.image('my-image').inside\{...\}}}. Since then, "entrypoint" is ignored and the capability to do selenium tests fails.


            This regression seems to be caused by JENKINS-37987 and the github commit [\[FIXED JENKINS-37987\] Override ENTRYPOINT, not just command, for WithContainerStep|https://github.com/jenkinsci/docker-workflow-plugin/commit/5b0586d6bd87fc4f108693ee9361252a24eb37d1]

            This Jira seem to be similar to JENKINS-39748

            h3. Testcase

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {

                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            The check "{{curl http://127.0.0.1:4444/wd/hub}}" will fail.

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused
            [Pipeline] }
            $ docker stop --time=1 c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            $ docker rm -f c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 7
            Finished: FAILURE
            {noformat}

            h3. Workaround

            The workaround is to manually start the Dockerfile entrypoint with {{sh "nohup /opt/bin/entry_point.sh &"}}.

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {
                    // WORKAROUND: MANUALLY START THE DOCKERFILE ENTRYPOINT
                    sh "nohup /opt/bin/entry_point.sh &"
                    sh "sleep 5"
                    
                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + nohup /opt/bin/entry_point.sh
            [Pipeline] sh
            [testSelenium2] Running shell script
            + sleep 5
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
            [Pipeline] writeFile
            [Pipeline] sh
            [testSelenium2] Running shell script
            + python selenium_remote_web_driver_test.python
            [Pipeline] }
            $ docker stop --time=1 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            $ docker rm -f 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            {noformat}
            The docker pipeline plugin used to honor the Dockerfile "entrypoint" until v1.8 in "{{docker.image('my-image').inside\{...\}}}". Since then, "entrypoint" is ignored.

            The capability to do selenium tests with a selenium-standalone-server running inside the Docker container fails since 1.8.


            This regression seems to be caused by JENKINS-37987 and the github commit [\[FIXED JENKINS-37987\] Override ENTRYPOINT, not just command, for WithContainerStep|https://github.com/jenkinsci/docker-workflow-plugin/commit/5b0586d6bd87fc4f108693ee9361252a24eb37d1]

            This Jira seem to be similar to JENKINS-39748

            h3. Testcase

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {

                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            The check "{{curl http://127.0.0.1:4444/wd/hub}}" will fail.

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused
            [Pipeline] }
            $ docker stop --time=1 c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            $ docker rm -f c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 7
            Finished: FAILURE
            {noformat}

            h3. Workaround

            The workaround is to manually start the Dockerfile entrypoint with {{sh "nohup /opt/bin/entry_point.sh &"}}.

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {
                    // WORKAROUND: MANUALLY START THE DOCKERFILE ENTRYPOINT
                    sh "nohup /opt/bin/entry_point.sh &"
                    sh "sleep 5"
                    
                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + nohup /opt/bin/entry_point.sh
            [Pipeline] sh
            [testSelenium2] Running shell script
            + sleep 5
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
            [Pipeline] writeFile
            [Pipeline] sh
            [testSelenium2] Running shell script
            + python selenium_remote_web_driver_test.python
            [Pipeline] }
            $ docker stop --time=1 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            $ docker rm -f 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            {noformat}
            cleclerc Cyrille Le Clerc made changes -
            Description The docker pipeline plugin used to honor the Dockerfile "entrypoint" until v1.8 in "{{docker.image('my-image').inside\{...\}}}". Since then, "entrypoint" is ignored.

            The capability to do selenium tests with a selenium-standalone-server running inside the Docker container fails since 1.8.


            This regression seems to be caused by JENKINS-37987 and the github commit [\[FIXED JENKINS-37987\] Override ENTRYPOINT, not just command, for WithContainerStep|https://github.com/jenkinsci/docker-workflow-plugin/commit/5b0586d6bd87fc4f108693ee9361252a24eb37d1]

            This Jira seem to be similar to JENKINS-39748

            h3. Testcase

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {

                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            The check "{{curl http://127.0.0.1:4444/wd/hub}}" will fail.

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused
            [Pipeline] }
            $ docker stop --time=1 c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            $ docker rm -f c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 7
            Finished: FAILURE
            {noformat}

            h3. Workaround

            The workaround is to manually start the Dockerfile entrypoint with {{sh "nohup /opt/bin/entry_point.sh &"}}.

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {
                    // WORKAROUND: MANUALLY START THE DOCKERFILE ENTRYPOINT
                    sh "nohup /opt/bin/entry_point.sh &"
                    sh "sleep 5"
                    
                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + nohup /opt/bin/entry_point.sh
            [Pipeline] sh
            [testSelenium2] Running shell script
            + sleep 5
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
            [Pipeline] writeFile
            [Pipeline] sh
            [testSelenium2] Running shell script
            + python selenium_remote_web_driver_test.python
            [Pipeline] }
            $ docker stop --time=1 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            $ docker rm -f 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            {noformat}
            The docker pipeline plugin used to honor the Dockerfile "entrypoint" until v1.8 in "{{docker.image('my-image').inside\{...\}}}". Since then, "entrypoint" is ignored.

            The capability to do selenium tests with a selenium-standalone-server running inside the Docker container fails since 1.8.


            This regression seems to be caused by JENKINS-37987 and the github commit "[\[FIXED JENKINS-37987\] Override ENTRYPOINT, not just command, for WithContainerStep|https://github.com/jenkinsci/docker-workflow-plugin/commit/5b0586d6bd87fc4f108693ee9361252a24eb37d1]".

            This Jira seem to be similar to JENKINS-39748

            h3. Testcase

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {

                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            The check "{{curl http://127.0.0.1:4444/wd/hub}}" will fail.

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to 127.0.0.1 port 4444: Connection refused
            [Pipeline] }
            $ docker stop --time=1 c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            $ docker rm -f c65380bfd6c83d2290fc2e8fa8e5ae4cb0b84d1b21c66b4a3019c4a831f8833c
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            ERROR: script returned exit code 7
            Finished: FAILURE
            {noformat}

            h3. Workaround

            The workaround is to manually start the Dockerfile entrypoint with {{sh "nohup /opt/bin/entry_point.sh &"}}.

            h4. Code

            {code}
            node ("docker") {
                docker.image('cloudbees/java-build-tools:2.0.0').inside {
                    // WORKAROUND: MANUALLY START THE DOCKERFILE ENTRYPOINT
                    sh "nohup /opt/bin/entry_point.sh &"
                    sh "sleep 5"
                    
                    // verify that selenium-standalone-server has been started by the Dockerfile entrypoint /opt/bin/entry_point.sh
                    sh "curl http://127.0.0.1:4444/wd/hub"
                    
                    // test with selenium python
                    writeFile (
                        file: 'selenium_remote_web_driver_test.python',
                        text:
            """#!/usr/bin/env python

            from selenium import webdriver
            from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

            driver = webdriver.Remote(
               command_executor='http://127.0.0.1:4444/wd/hub',
               desired_capabilities=DesiredCapabilities.FIREFOX)

            driver.get('http://python.org')
            assert 'Python' in driver.title
            """)

                    sh "python selenium_remote_web_driver_test.python"

                }
            }
            {code}

            h4. Console

            {noformat}
            Started by user admin
            [Pipeline] node
            Running on agent-1 in /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + docker inspect -f . cloudbees/java-build-tools:2.0.0
            .
            [Pipeline] withDockerContainer
            $ docker run -t -d -u 1000:1000 -w /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2 -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2:rw -v /home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:/home/ubuntu/jenkins-aws-home/workspace/tests/testSelenium2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat cloudbees/java-build-tools:2.0.0
            [Pipeline] {
            [Pipeline] sh
            [testSelenium2] Running shell script
            + nohup /opt/bin/entry_point.sh
            [Pipeline] sh
            [testSelenium2] Running shell script
            + sleep 5
            [Pipeline] sh
            [testSelenium2] Running shell script
            + curl http://127.0.0.1:4444/wd/hub
              % Total % Received % Xferd Average Speed Time Time Time Current
                                             Dload Upload Total Spent Left Speed

              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
              0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
            [Pipeline] writeFile
            [Pipeline] sh
            [testSelenium2] Running shell script
            + python selenium_remote_web_driver_test.python
            [Pipeline] }
            $ docker stop --time=1 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            $ docker rm -f 804a1f9cac0e8040b5e882a7c3ebd052df53e9cb99b34c0a7ffba4d0abff5401
            [Pipeline] // withDockerContainer
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            {noformat}
            cleclerc Cyrille Le Clerc made changes -
            Link This issue relates to JENKINS-39485 [ JENKINS-39485 ]
            cleclerc Cyrille Le Clerc made changes -
            Link This issue relates to JENKINS-39748 [ JENKINS-39748 ]
            cleclerc Cyrille Le Clerc made changes -
            Link This issue relates to JENKINS-37987 [ JENKINS-37987 ]
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #85 (Web Link)" [ 15339 ]
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-39748 [ JENKINS-39748 ]
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            abayer Andrew Bayer made changes -
            Resolution Duplicate [ 3 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Assignee Andrew Bayer [ abayer ] Nicolas De Loof [ ndeloof ]
            cleclerc Cyrille Le Clerc made changes -
            Link This issue is related to JENKINS-47890 [ JENKINS-47890 ]
            ndeloof Nicolas De Loof made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            lsmadja ludovic SMADJA made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            ndeloof Nicolas De Loof made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            hendrikhalkow Hendrik Halkow made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            rtyler R. Tyler Croy made changes -
            Link This issue relates to JENKINS-49446 [ JENKINS-49446 ]
            ndeloof Nicolas De Loof made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            ndeloof Nicolas De Loof made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            sachin771 sachin gupta made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            ndeloof Nicolas De Loof made changes -
            Assignee Nicolas De Loof [ ndeloof ]

              People

              • Assignee:
                Unassigned
                Reporter:
                cleclerc Cyrille Le Clerc
              • Votes:
                8 Vote for this issue
                Watchers:
                32 Start watching this issue

                Dates

                • Created:
                  Updated: