The image had no command, so the container exited immediately (0). dnsmasq also daemonizes by default; -k keeps it as PID 1.