Those are pretty powerful ways to learn. With git, you can jump branches pretty easily as you proceed through the steps of a tutorial (either for the student or for the teacher to provide some assets for that step)
Docker allows a packaged environment without having to install a bunch of dependencies, and easily shut down/remove those environments.