There is a similar treaty that applies to Antarctica. We know how to build bases there (there are over 50 research stations in Antarctica). If the Antarctic Treaty was broken by building a military base, there'd be a precedence for building a military base on the Moon too — once we've figured out how — and breaking the Outer Space Treaty.