As with any solid container the issue is all the air the beans are exposed to as you use them up and the level of the beans decreases.
Light, heat, and air are the enemies of roasted beans. Best practice is to store your roasted beans in a container where they completely fill it, such as in an airtight/oneway valved bag that you can squeeze all the air out of and then seal, and then put it in a place out of any light and away from any heat source.
There are literally hundreds (Thousands?) of posts on here covering every aspect of bean storage and peoples thoughts/opinions/experience on the subject. Use the search function (Near the upper right corner on every page.) to find them and have a good read of them for the answers to all your questions.
Java "Cute idea but..." phile