Hi 👋, My name is Hamza and this is my first blog post. The reason for this blog post is to document my journey of learning Rust. I have been learning rust on and off for an year now but never really got to doing something with it because i always end up using AI to write my code. this has took a tremendous toll on my learning curve and i have decided to change that. I will be documenting my journey of learning Rust and i hope that it will help someone out there.

Why Docker?

I learn alot of new technologies, whatever I hear about, I’m always really eager to try it out. For that reason, I’ve to install a bunch of software on my machine and then every few months I reinstall the OS to get rid of everything. The cycle repeats itself. I’ve been using Docker for a while now and I’ve been loving it. I can spin up a container with all the software I need and then just delete the container when I’m done. For that reason, I’ve decided to use Docker Dev containers for my Rust development environment.

Setting up Docker Dev Container with VSCode

  1. Install Docker Desktop
  2. Install VSCode
  3. Install Remote Development Extension Pack in VSCode
  4. Open VSCode and press Ctrl + Shift + P and type

Dev Container: Add Development Container Configuration Files...

  1. Select Rust and then bullseye as the base image
  2. Skip the additional configuration and press Enter
  3. Wait for the container to build and then press Reopen in Container
  4. You should now be in a Rust development environment.

Confirming Rust Installation

  1. Open a terminal in VSCode
  2. Type rustc --version and press Enter
  3. You should see something like this:
rustc 1.55.0 (c8dfcfe04 2021-09-06)
  1. Type cargo --version and press Enter
  2. You should see something like this:
cargo 1.55.0 (32da73ab1 2021-08-23)
  1. You are now ready to start learning Rust.

Conclusion

See? That was so easy. No need to install anything on your machine. You can just delete the container when you’re done and start over again.