I have not attempted to attach magnets to plastic but I have come across this problem when needing to assure a good bond with building materials. You might want to try drilling small holes into the bottom of the containers and magnet so the glue/epoxy can ooze into the holes making a dowel out of the hardened glue.