1. Updates the Dockerfile to the same image and flags as the CI. 2. Sets `-O2` as the default CMake Release flag rather than passing it in a custom way.