Proper parser for Dockerfile

Closes #2225. This pull request implements a proper parser for Docker build files.