Dockler sets container IP address from DHCP / DNS automatically

While I have discovered several options to force docker containers to have an IP address that matches my DNS, I have not found any way to force a persistent IP address automatically when docker starts.

I currently have a small script that fetches IP addresses from my DNS network and container configurations directly from the docker host. Unfortunately this method does not work with autostart, preventing tools like docker-ui from being used.

My script is available at https://gist.github.com/fulup-bzh/8fd32c8cde9a1e5ec971 the script works great, but I would like it to happen automatically to allow users to use tools like "docker-ui"

Question: - is there a way to force the "autorun" script at the host level during "docker run" startup? - alternatively, is there a way to automatically set the container IP address from DHCP from the host?

+3


source to share





All Articles