Docker Community Forums

Share and learn in the Docker community.

Docker image problem


(Sergiyivanovatgti) #1

Hi there. I wonder how could i build docker image so my process will obtain PID = 1? For now i have in Dockerfile:

ENTRYPOINT [ “/sbin/run_persistence.sh” ]

ugly hack

CMD [""]

docker inspect shows as expected:

“Path”: “/sbin/run_persistence.sh”,
“Args”: [
“.some_arg_from_docker_run”
],

BUT! docker exec and ps inside show:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 18060 2816 ? Ss 16:19 0:00 /bin/bash /sbin/run_persistence.sh

Why it wrapped into /bin/bash? I cannot handle signals because of this… On the other hand i need argument be propagated right from docker run as value is not known at build time. How could i handle both requirements?