Why not have solar modules in a shipping container form factor. (Maybe shorter in height though) and stack those at the top layer when loading the ship.
You could probably even find some ingenious way to run the current through the containers stacked umderneath to route the power. They are made of metal.
Shipping companies don't own the containers. Solar panels would get broken when they were transferred to shore. Panels and cabling would add more weight to the highest level of the cargo stacks: the worst place for ship stability. And even if you covered the entire top level with solar panels it still wouldn't provide enough propulsion power to be worth the expense.