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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -