Fix race condition by fetching sockets before starting container.