Commiting images is a discouraged and messy feature of Docker. If at all possible it should be avoided and a Dockerfile should be used.