I believe that could expose moisture to stringers, foam, etc if using screws. I would mount it on the inside wall of that locker.
A second option is to apply some good industrial grade Velcro to the black box and it should hold pretty good to the carpet.