FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive

RUN printf 'deb http://archive.nic.cz/experimental xenial main\n' > /etc/apt/sources.list.d/cz.nic.list \
        && printf 'deb http://archive.nic.cz/ubuntu xenial main\n' >> /etc/apt/sources.list.d/cz.nic.list \
        && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1C0200016A9AC5C6

RUN apt-get -y update && apt-get install -y curl
RUN printf 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main\n' > /etc/apt/sources.list.d/postgres.list \
        && curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

RUN apt-get -y update                       \
        && apt-get -y install               \
            cmake                           \
            postgresql-server-dev-9.6       \
            pkg-config                      \
            build-essential                 \
            ninja-build                     \
            bash-completion                 \
            git                             \
            libpq-dev                       \
            libboost-program-options-dev    \
            libboost-thread-dev             \
            libboost-regex-dev              \
            libboost-filesystem-dev         \
            libboost-random-dev             \
            libboost-test-dev               \
        && apt-get -y clean                 \
        && rm -rf /var/lib/apt/lists/*
