It means you're not perfect, but you're good enough. It is humorous in your examples, but it needn't be when applied to more practical situations:
The banana is a little too ripe, but it'll do for this recipe. The tire's tread is worn, but it'll do as a spare.
It probably originated as an abbreviation of "it will do the job," which means it is adequate to get the job accomplished.