Docker – Kerberos KDC server in a docker container

dockerkerberosmitkerberos

I'm running a MIT Kerberos KDC and Kadmin server instances on a docker container for convenience. Am able to build it and run it without a problem, with only extracting important configs do a docker volumes. Am also connecting the KDC to OpenLDAP through kldap module.

However, one possible problem I'm seeing: with each rebuild it seems the KDC initiates different keychains or something, which causes the old authentications to break. All of this makes sense and is not a problem.

My question: is it possible to store the internal database of the KDC (or where is it storing the credentials) to a docker volume? If so, which part should I be looking at?

My goal is that for whatever rebuild of the container, I would be able to connect to the same old KDC database that was made by the old containers. Is this possible?

Best Answer

Isn't just enough to mount the volume to the container's default KDC database path like docker run -v /var/local/docker-volumes/krb5kdc:/usr/local/var/krb5kdc <kdc_image>? Or you can specify database_name option inside your realm configuration in kdc.conf if you want different mounting point in the container.

Related Topic