DiegoRenan / ruby-3-tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install Docker

Running tutorial

  1. Init bundle
bundle init
  1. Generate a Gemfile.lock
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:3.2.3 bundle install
  1. Build ruby-3-tutorial image
docker build -t ruby-3-tutorial .
  1. Running a ruby-3-tutorial container
docker run -it --name ruby-3-tutorial ruby-3-tutorial

Should be printed "Hello, world!"

Running a single script

docker run -it --rm --name ruby -v "$PWD":/usr/src/app -w /usr/src/app ruby:3.2.3 ruby hello_world.rb

Should be printed "Hello, world!"

Try examples with interactive terminal mode

docker run -it ruby:3.2.3

About


Languages

Language:Ruby 90.3%Language:Dockerfile 9.7%