This is another alternative that may suit your needs. You would need to create a custom script and a Dockerfile:
> cat Dockerfile.custom
# Custom docker instructions here
COPY rootfs /
> cat rootfs/init.sh
# Requirement to get Jenkins up and running
nami start tomcat
# The container expects a foreground command to run here
tail -f /opt/bitnami/tomcat/logs/catalina.out
With this second script you would be able to execute the commands you want and having Jenkins initialized in the background. You need to have a foreground command running at the end so the container does not terminate.
Would that work for you?
Javier J. Salmerón
Was my answer helpful? Click on