docker-java-parser A parser, linter and syntax checker for Dockerfiles for Java. Dockerfile df = Dockerfile.parse(new File("Dockerfile")); df.getFrom(); // alpine:3.7 df.getLabels(); // {maintainer=ThStock@example.org} df.getEnv(); // {VERSION=9} See also https://docs.docker.com/engine/reference/builder/