Fix the Docker container in a simplified work environment where the main project fails to run because the container is broken in a non-trivial way.
Implement repair_container(dependencies, broken_layers). dependencies maps each layer to the layers it requires, and broken_layers lists layers known to be invalid. Return the layers that must be rebuilt, including all transitive dependents, in a valid dependency-first order.
Assume every referenced layer exists and the complete dependency graph is acyclic. Return an empty list when no layers are broken.
def repair_container(dependencies, broken_layers):