A superconducting quantum interference device (SQUID) with single-walled carbon nanotube (CNT) Josephson junctions is presented. Quantum confinement in each junction induces a discrete quantum dot (QD) energy level structure, which can be controlled with two lateral electrostatic gates. In addition, a backgate electrode can vary the transparency of the QD barriers, thus permitting change in the hybridization of the QD states with the superconducting contacts. The gates are also used to directly tune the quantum phase interference of the Cooper pairs circulating in the SQUID ring. Optimal modulation of the switching current with magnetic flux is achieved when both QD junctions are in the `on' or `off' state. In particular, the SQUID design establishes that these CNT Josephson junctions can be used as gate-controlled π-junctions that is, the sign of the current-phase relation across the CNT junctions can be tuned with a gate voltage. The CNT-SQUIDs are sensitive local magnetometers, which are very promising for the study of magnetization reversal of an individual magnetic particle or molecule placed on one of the two CNT Josephson junctions.