In Dockerfile, I put in the following:
COPY docker-files/krb5.conf /etc
RUN /usr/sbin/krb5kdc -P /var/run/krb5kdc.pid;
Expectation is that KDC would be started when I use "docker run -it" command.
However, KDC is not running after starting docker VM. Was my expectation correct ?
Thanks
RUN is not the same as CMD
https://docs.docker.com/engine/reference/builder/#cmd
or
ENTRYPOINT
https://docs.docker.com/engine/reference/builder/#entrypoint
By default a docker container executes what it has in CMD and exits, so that is "normal".
Try replacing RUN by CMD, rebuild and relaunch
See also creack answer in
What is the difference between CMD and ENTRYPOINT in a Dockerfile?