# syntax=docker/dockerfile:1 FROM osgeo/gdal:ubuntu-small-3.5.0 as base #------------------------------------------------------------------------------ # Dev setup 1 #------------------------------------------------------------------------------ FROM base as ruby_builder RUN apt-get update -yqq \ && apt-get upgrade -yqq \ && apt-get install -yqq --no-install-recommends \ build-essential \ libffi-dev \ libgeos-dev \ libproj-dev \ libyaml-dev \ && rm -rf /var/lib/apt/lists/* ENV GEM_HOME /gems ENV BUNDLE_SILENCE_ROOT_WARNING=1 \ BUNDLE_APP_CONFIG="$GEM_HOME" ENV PATH $GEM_HOME/bin:$PATH RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME" COPY --from=ruby:3.1.2 --chown=root /usr/local/bin/* /usr/local/bin/ COPY --from=ruby:3.1.2 --chown=root /usr/local/lib/libruby.so.3.1.2 /usr/local/lib/ RUN ln -s /usr/local/lib/libruby.so.3.1.2 /usr/local/lib/libruby.so COPY --from=ruby:3.1.2 --chown=root /usr/local/lib/pkgconfig/ruby-3.1.pc /usr/local/lib/pkgconfig/ COPY --from=ruby:3.1.2 --chown=root /usr/local/lib/ruby/3.1.0 /usr/local/lib/ruby/3.1.0 COPY --from=ruby:3.1.2 --chown=root /usr/local/lib/ruby/gems /usr/local/lib/ruby/gems COPY --from=ruby:3.1.2 --chown=root /usr/local/lib/ruby/site_ruby /usr/local/lib/ruby/site_ruby COPY --from=ruby:3.1.2 --chown=root /usr/local/lib/ruby/vendor_ruby /usr/local/lib/ruby/vendor_ruby COPY --from=ruby:3.1.2 --chown=root /usr/local/include/ruby-3.1.0 /usr/local/include/ruby-3.1.0 COPY --from=ruby:3.1.2 --chown=root /usr/local/etc/gemrc /usr/local/etc/gemrc # Link the libraries after copying them over from the ruby image. RUN ldconfig RUN gem update --system \ && gem install bundler #------------------------------------------------------------------------------ # Dev setup 1 #------------------------------------------------------------------------------ FROM ruby_builder as dev_builder RUN apt-get update -yqq \ && apt-get install -yqq --no-install-recommends \ git \ librttopo-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* COPY ./ffi-gdal.gemspec /usr/src/ffi-gdal/ COPY ./lib/ffi/gdal/version.rb /usr/src/ffi-gdal/lib/ffi/gdal/ COPY ./Gemfile* /usr/src/ffi-gdal/ WORKDIR /usr/src/ffi-gdal # Use a docker volume for storing gems ENV BUNDLE_PATH /gems RUN bundle install #------------ # Copy over the rest of the lib COPY . . CMD ["tail", "-f", "/dev/null"] # vim:ft=dockerfile