The detection of ships encompasses an abundance of applications within the domains of fishery management, marine rescue operations, and maritime monitoring. In recent years, a multitude of detectors based on deep learning have been utilized for the purpose of ship detection using synthetic aperture radar (SAR) images. However, disturbed by the strong scattering background on land and the influence of the SAR target scale, the existing detectors face great challenges in detecting inshore small ships. To solve this problem, this article proposes an oriented ship detection network for SAR images based on soft threshold and context information. First, a soft-threshold quantization module (STQM) based on the soft threshold function is designed to alleviate the interference of background noise on the feature map. Second, a local and global context fusion module (LGCFM) is designed to capture the contextual information of the target to enhance the detection of small targets. Third, the inclusion of the center loss in the loss function serves to impose additional constraints on the center coordinates and shape of the oriented bounding box. This is done to achieve a more balanced distribution of loss contributions across the various variables and to mitigate the target's susceptibility to variations in the shape of the ground-truth bounding box. Finally, the proposed network is tested on the publicly available mini-rotated-high-resolution SAR images dataset (MR-HRSID) and Rotated SAR Ship Detection Dataset (R-SSDD) datasets. The results from experiments demonstrate that our approach attains state-of-the-art detection capabilities for inshore ships and small targets, while also effectively mitigating interference from terrestrial noises.