Smart containers have been extensively applied in the maritime industry by embracing the Internet of Things to realize container status monitoring and data offloading without human intervention. However, the offloading rate and delay in the offshore region are limited by the coverage of the onshore base station (BS). In this paper, we investigate the unmanned aerial vehicle (UAV)-assisted data offloading for smart containers in offshore maritime communications where the UAV is as a relay node between smart containers and onshore BS. We first consider the mobility of container vessel in the offshore region and establish a UAV-assisted data offloading model. Based on this model, a data offloading algorithm is proposed to reduce the average offloading delay under data-size requirements and available energy constraints of smart containers. Specifically, the convex-concave procedure is used to update time-slot assignment, offloading approach selection, and power allocation in an iterative manner. Simulation results show that the proposed algorithm can efficiently reduce average offloading delay and increase offloading success ratio. Moreover, it is shown that the UAV relay cannot always bring the performance gain on offloading delay especially in the close-to-shore area, which could give an insight on the deployment of UAV relay in offshore communications.