Containers for collecting or depositing substances in boreholes or wells