Dockerfile : RUN results in a No op

前端 未结 1 502
时光取名叫无心
时光取名叫无心 2021-01-26 11:59

I have a Dockerfile, in which im trying to run a deamon that starts a java process.

If I embed the script in the Dockerfile, like so.

RUN myscript.sh
         


        
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-26 12:38

    Background-processes needs to be started at container-start, not image build. So your script needs to run via CMD or ENTRYPOINT.

    CMD or ENTRYPOINT can still be a script, containing multiple commands. But I would imagine in your case, if you want several background processes, that using example supervisord would be your best option.

    Also, check out some already existing Dockerfiles to get an idea of how it all fits together.

    0 讨论(0)
提交回复
热议问题