describes
someone who displays courage in familiar surroundings where it is unlikely to be tested.
also
Every cock is bold on his own dunghill.
He boasts about his courage among his friends but backs down when challenged by strangers. A cock is valiant on his own dunghill.