Docker multiple entrypoints

后端 未结 9 873
情深已故
情深已故 2020-12-13 00:08

Say I have the following Dockerfile:

FROM ubuntu

RUN apt-get update
RUN apt-get install -y apache2
RUN apt-get install -y mongod #pretend this exists

EXPOS         


        
9条回答
  •  感动是毒
    2020-12-13 00:25

    I can think of several ways:

    • you can write a script to put on the container (ADD) that does all the startup commands, then put that in the ENTRYPOINT
    • I think you can put any shell commands on the ENTRYPOINT, so you can do service mongod start && /usr/sbin/apache2

提交回复
热议问题