Docker: how to restart process inside of container?

前端 未结 3 1759
梦如初夏
梦如初夏 2021-02-05 11:47

I have a set of tests which I would like to run on docker container. In the middle of the tests I am changing me test data and I need to restart JETTY.

What is the bes

3条回答
  •  伪装坚强ぢ
    2021-02-05 12:22

    you need to use an entrypoint shell script you will need to build your docker file so that you can copy the files in to the container.

    your entrypoint.sh or call it runjettytests.sh

    pseudo code for that will look like:

    #!/bin/sh
    java -jar start.jar
    $runTests
    java -DSTOP.PORT=8080 -DSTOP.KEY=stop_jetty -jar start.jar --stop
    cp dataset2 data/
    java -jar start.jar
    $runTests2
    java -DSTOP.PORT=8080 -DSTOP.KEY=stop_jetty -jar start.jar --stop
    exit(0)
    

    clearly your use case may vary but thats a rough idea

提交回复
热议问题