- Practice using Docker (or Containerization, in general) through the incremental evolution of this Environment.
- Test and experiment with the Ruby language and features within this container that can easily be setup anywhere
- Install Docker
- Clone this repo
cd
into this repo directory- Build the image
docker build . -t alp_v3_20-ruby_3_3_3:v1
. You can tag it however you'd like. An explanation of this command:docker build .
- The.
means from "here", meaning, from our current directory (assuming youcd
into this repo and are using itsDockerfile
)-t <name:tag>
- You can then run it interactively
docker run -it alp_v3_20-ruby_3_3_3:v1
; it'll start, launch a shell, and you'll be inside the container, able to execute Ruby commands.
If you'd like to use this container to run code that is local to your machine, you can do so by adding the -v
flag. It's easier if you navigate to the location of the Ruby code you'd like to run, but not necessary. Here's an example:
cd ~/<user>/some/dir
# "app" is because this container uses it as its Working Directory
# the "-v .:/app" basically means, mount the files of our current location to the /app directory in the container using the image of <name:tag>
docker run -it -v .:/app alp_v3_20-ruby_3_3_3:v1
You should be able to run some Ruby code and any MiniTest assertions!
Enjoy!