#1 Use an official Ruby runtime as a parent image FROM ruby:3.1.2
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
RUN bundle install
RUN gem install bundler
COPY . .
EXPOSE 4567
CMD ["ruby", "app.rb"] source "https://rubygems.org"
gem "sinatra" gem "rackup" source "https://rubygems.org"
gem "sinatra" require 'sinatra'
get '/' do 'Hello, world!' end
#2
FROM ruby:3.1.2
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
RUN bundle install
RUN gem install bundler
COPY . .
EXPOSE 3000
CMD ["ruby", "app.rb"] source "https://rubygems.org"
gem "sinatra" gem "rackup" source "https://rubygems.org"
gem "sinatra" require 'sinatra'
get '/' do 'Hello, world!' end
Content type
Image
Digest
sha256:17c1b1376…
Size
346.4 MB
Last updated
over 2 years ago
docker pull rdcool/ruby