Random color on multiple multi-component objects obtained by applying an array modifier
I think that you shouldn't use an array.

Use a particle system instead. Create a mesh were the containers would be:


Then add a particle system, star on 1 and end on 1, choose volume as emit form and grid.


Now you will have this:


If your containers aren't square (probably) change the scale in object mode of the emmiter to be similar to the container ratio.

Change the physics to "No", render to "Object" choose the object (with the material of the link that you already visited) and change the size as you need:



Any other question, just ask.