2016-10-03 17:21:57 +03:00
|
|
|
# vim:set ft=dockerfile:
|
2020-10-06 18:39:43 +03:00
|
|
|
FROM ubuntu:focal
|
2016-10-03 17:21:57 +03:00
|
|
|
|
|
|
|
# explicitly set user/group IDs
|
|
|
|
RUN groupadd -r postgres --gid=999 && useradd -r -d /var/lib/postgresql -g postgres --uid=999 postgres
|
|
|
|
|
|
|
|
# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default
|
2017-03-30 17:07:35 +03:00
|
|
|
RUN apt-get update && apt-get install -y software-properties-common locales && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
2016-10-03 17:21:57 +03:00
|
|
|
ENV LANG en_US.utf8
|
2018-08-18 22:34:31 +03:00
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
2016-10-03 17:21:57 +03:00
|
|
|
|
2021-10-02 01:42:37 +03:00
|
|
|
ENV PG_MAJOR 14
|
2016-10-03 17:21:57 +03:00
|
|
|
|
2020-10-06 18:39:43 +03:00
|
|
|
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
|
2017-03-30 17:07:35 +03:00
|
|
|
|
2019-04-14 21:38:11 +03:00
|
|
|
RUN apt-get -o Acquire::AllowInsecureRepositories=true \
|
|
|
|
-o Acquire::AllowDowngradeToInsecureRepositories=true update \
|
2018-08-18 22:34:31 +03:00
|
|
|
&& apt-get \
|
|
|
|
-o Dpkg::Options::="--force-confdef" \
|
|
|
|
-o Dpkg::Options::="--force-confold" \
|
2019-04-14 21:38:11 +03:00
|
|
|
-o APT::Get::AllowUnauthenticated=true \
|
2018-08-18 22:34:31 +03:00
|
|
|
install -y postgresql-common \
|
2016-10-03 17:21:57 +03:00
|
|
|
sudo \
|
|
|
|
libpq-dev \
|
2018-08-18 22:34:31 +03:00
|
|
|
python3-pip \
|
2016-10-03 17:21:57 +03:00
|
|
|
python2.7-dev \
|
2020-10-06 18:39:43 +03:00
|
|
|
python3.8-dev \
|
2016-10-03 17:21:57 +03:00
|
|
|
postgresql-$PG_MAJOR \
|
|
|
|
postgresql-contrib-$PG_MAJOR \
|
2018-08-18 22:34:31 +03:00
|
|
|
&& pip3 install tox
|
2016-10-03 17:21:57 +03:00
|
|
|
|
|
|
|
COPY ./ /dist
|
|
|
|
|
|
|
|
CMD ["/dist/run_test.sh"]
|