docker-java-parser A parser for Dockerfiles in 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/