Magnetic skyrmions, localized swirling spin textures with topologically protection, are of particular interest from fundamentally intriguing physics to new spintronic applications. For the envisioned skyrmion-based applications, the skyrmions are required to be manipulated in geometrically confined structures, instead of infinite sheets of material. Therefore, the interaction between skyrmions and the edge boundaries of the magnetic structure is crucial. In fact, this interaction can prevent skyrmions from being expelled from the track and assist in their propagation velocity with reduced sized, it could be possible to achieve larger data storage densities and faster performance. In this work, we report on a convenient analytical methodology to determine the profile of confining potential of a skyrmion in one-dimensional confined geometries. Our results would be of value in the study of magnetic energetics and could give fresh impetus to the design of skyrmion-based devices.