Nokogiri On Alpine

#docker #sysadmin

To get nokogiri to install on the ruby:2-alpine Docker image, add the following to the bndle config in addition to requiring the dev packages:

bundle config build.nokogiri \
    --use-system-libraries \
    --with-xml2-lib=/usr/include/libxml2 \
    --with-xml2-include=/usr/include/libxml2
RUN apk add --update \
  build-base \
  gcc \
  gdbm \
  libc-dev \
  libffi \
  libgcrypt \
  libxml2-dev \
  libxslt-dev \
  linux-headers \
  openssl-dev \
  postgresql-dev \
  ruby-dev \
  zlib-dev