Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.44 KB

README.md

File metadata and controls

28 lines (22 loc) · 1.44 KB

Alpine Linux Ruby Environment

Purpose:

  1. Practice using Docker (or Containerization, in general) through the incremental evolution of this Environment.
  2. Test and experiment with the Ruby language and features within this container that can easily be setup anywhere

Usage:

  1. Install Docker
  2. Clone this repo
  3. cd into this repo directory
  4. 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:
    1. docker build . - The . means from "here", meaning, from our current directory (assuming you cd into this repo and are using its Dockerfile)
    2. -t <name:tag>
  5. 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.

With a "Volume"

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!