I believe there are religious exemptions for some Israeli Jews that legally permits them to not serve in the IDF. In addition, I believe that Israeli Arabs are not required to serve in the IDF, but some do serve willingly. Finally, there are Israeli conscientious objectors who end up serving a prison sentence in order to avoid serving in the IDF.
Please correct me if I am wrong.