diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4d2be69 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +*.bundle +*.so +*.o +*.a +mkmf.log + +# rspec failure tracking +.rspec_status + +# Added by cargo +/target + +# Built gems +*.gem diff --git a/docker/Dockerfile b/docker/Dockerfile index fa16089..a449a1d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,8 +1,17 @@ FROM ruby:3.2.3 WORKDIR /app + +# Install the requirements we need to build the native Rust extensions RUN apt-get update -qq && \ apt-get upgrade -y && \ apt-get install -y libclang-dev -COPY Gemfile /app + +# Package and install the gem +COPY . /app +RUN gem build tzf.gemspec +RUN gem install tzf-*.gem + +# Run a sanity check +WORKDIR /app/docker RUN bundle install -CMD echo 'Hello, world!' +CMD ruby sanity_check.rb diff --git a/docker/Gemfile b/docker/Gemfile index 28e74ad..13135d2 100644 --- a/docker/Gemfile +++ b/docker/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" # gem "rb_sys", "0.9.87" -gem "tzf", git: "https://github.com/HarlemSquirrel/tzf-rb", branch: "bundle-update-20240219" +gem "tzf" diff --git a/docker/sanity_check.rb b/docker/sanity_check.rb new file mode 100644 index 0000000..43df53b --- /dev/null +++ b/docker/sanity_check.rb @@ -0,0 +1,5 @@ +require "bundler/setup" +require "tzf" + +puts TZF::VERSION +puts TZF.tz_name(40.74771675713742, -73.99350390136448)