Multi-stage builds (which added the FROM ... AS ... syntax along with multiple FROM lines) require 17.05 or newer. You'll need to upgrade your docker server.
For more details on multi-stage builds, see: https://docs.docker.com/develop/develop-images/multistage-build/