docker - adding startup script to dockerfile -
i have built docker image using openjdk.
# config dockerfile openjdk:8 copy . /usr/src/myapp workdir /usr/src/myapp # build image docker build -t shantanuo/dbt .
it working expected using command...
docker run -p 8081:8080 -it shantanuo/dbt
once log-in, have run command...
sh bin/startup.sh
my question: possible add startup command dockerfile? tried adding line in dockerfile.
cmd ["sh", "bin/startup.sh"]
but after building image, can not use -d parameter start container.
you can use entrypoint run startup script. in entrypoint can specify yoour custom script , run catlina.sh. example:
entrypoint "bin/startup.sh && catalina.sh run"
this run startup script , start tomcat server. wont exit container.
Comments
Post a Comment