message: split build and run dependencies.
  chain the run so build dependencies are installed, galera is built,
  and then uninstalled this reduces the images size by about 500mb.
diff: @@ -5,14 +5,6 @@ ENV MARIADB_DATABASE=drupal \
  MARIADB_USER=drupal \
  MARIADB_PASSWORD=drupal
  -
  -# fix some environmental items
  -# RUN mkdir -p /usr/include/bits; mkdir -p /usr/
  -# COPY wordsize.h /usr/include/bits/wordsize.h
  -# replace poll.h with one that doesn't break the build
  -# RUN echo "#include <poll.h>" > /usr/include/sys/poll.h
  -
  -
  RUN apk add --update --no-cache --virtual .mariadb-run-deps \
  libaio \
  libstdc++ \
  @@ -27,8 +19,14 @@ RUN apk add --update --no-cache --virtual .mariadb-run-deps \
  lsof \
  procps \
  findutils \
  - tzdata && \
  - apk add --update --no-cache --virtual .mariadb-build-deps \
  + tzdata
  +
  +
  +# fix some environmental items
  +RUN mkdir -p /usr/include/bits; mkdir -p /usr/
  +COPY wordsize.h /usr/include/bits/wordsize.h
  +
  +RUN apk add --update --no-cache --virtual .mariadb-build-deps \
  attr \
  autoconf \
  bison \
  @@ -41,25 +39,15 @@ RUN apk add --update --no-cache --virtual .mariadb-run-deps \
  ncurses-dev \
  patch \
  readline-dev \
  - zlib-dev
  -
  -
  -
  -
  -# fix some environmental items
  -RUN mkdir -p /usr/include/bits; mkdir -p /usr/
  -COPY wordsize.h /usr/include/bits/wordsize.h
  -
  -
  -RUN cd /tmp; git clone https://github.com/libcheck/check.git ; cd check; mkdir build ; cd build ; cmake ../ ; make ; make install ;
  -
  -RUN cd /tmp && git clone -b mariadb-3.x https://github.com/MariaDB/galera.git
  -
  -RUN cd /tmp/galera && sed -i s/PAGE_SIZE/PAGE_SIZE_64K/g galerautils/src/gu_alloc.cpp && sed -i '/#include <limits>/a #include <stdint.h>' galerautils/src/gu_datetime.hpp
  -
  -RUN cd /tmp/galera && ./scripts/build.sh --so strict_build_flags=0
  -
  -RUN mkdir -p /usr/lib64/galera && mv /tmp/galera/libgalera_smm.so /usr/lib64/galera/libgalera_smm.so
  + zlib-dev ; \
  + cd /tmp && git clone https://github.com/libcheck/check.git && cd check && mkdir build && cd build && cmake ../ && make && make install; \
  + cd /tmp && git clone -b mariadb-3.x https://github.com/MariaDB/galera.git; \
  + cd /tmp/galera && sed -i s/PAGE_SIZE/PAGE_SIZE_64K/g galerautils/src/gu_alloc.cpp && sed -i '/#include <limits>/a #include <stdint.h>' galerautils/src/gu_datetime.hpp ; \
  + cd /tmp/galera && ./scripts/build.sh --so strict_build_flags=0 ; \
  + mkdir -p /usr/lib64/galera && mv /tmp/galera/libgalera_smm.so /usr/lib64/galera/libgalera_smm.so ; \
  + apk del --purge .mariadb-build-deps; \
  + rm -rf /tmp/*; \
  + rm -rf /var/cache/apk/*
  COPY root/usr/bin/peer-finder /usr/bin/peer-finder
  COPY root/usr/libexec/container-setup.sh /usr/libexec/container-setup.sh
  