It would be better to make multiple commands all going towards a certain goal be a multiline RUN command, so that there's only one checkpoint and less AUFS layers. Example at https://github.com/crashsystems/gitlab-docker/blob/master/Dockerfile#L23-L31