"A container had a line with a number beside it for every hour."
When determining the antecedent of a pronoun, the most recent noun should be examined first, and then you work your way backwards.
In the sentence above, there are three nouns. Working backwards, they should be analyzed as follows:
number. That noun is at the end of a prepositional phrase that logically says "I'm not actually the antecedent."
line. This is the most likely contender - a number beside the line makes sense, but it's not iron clad.
Container. I can't rule it out, but a number beside a container makes a lot less sense than a number next to a line. I'd go with #2.