2 GB is huge! Maybe you should look at base images like Alpine and build binaries for your dependencies. Also, instead of using a common image for all your environments, split it up, and use the image according to the required environment. If you are creating one container per student, it shouldn’t exceed 30 MB. I admit that I’m making a blind assertion here. Maybe it’s impossible to do so for your requirement?