forked from telus-agcg/ffi-gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.gdal3
73 lines (56 loc) · 2.33 KB
/
Dockerfile.gdal3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# 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