He fell asleep, and they locked the container and put it on the ship.
Then someone else locked him in; he didn’t lock himself in.