Set up your local environment

First, we’ll create a sample Ruby app that you can use when developing your buildpack:

mkdir ruby-sample-app

Create a file in the current directory called ruby-sample-app/app.rb with the following contents:

require 'sinatra'

set :bind, '0.0.0.0'
set :port, 8080

get '/' do
  'Hello World!'
end

Then, create a file called ruby-sample-app/Gemfile with the following contents:

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "sinatra"

Finally, make sure your local Docker daemon is running by executing:

docker version

If you see output similar to the following, you’re good to go! Otherwise, start Docker and check again.

Client: Docker Engine - Community
 Version:           20.10.9
 API version:       1.41
 Go version:        go1.16.8
 Git commit:        c2ea9bc
 Built:             Mon Oct  4 16:08:29 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.9
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.8
  Git commit:       79ea9d3
  Built:            Mon Oct  4 16:06:34 2021
  OS/Arch:          linux/amd64
  Experimental:     false

Next Step