|
| 1 | +FROM ubuntu:noble |
| 2 | +ARG CITUS_VERSION |
| 3 | +# FOrmat should be XY and should not include dots e.g for 10.2.1=>102 |
| 4 | +ARG CITUS_MAJOR_VERSION |
| 5 | +ARG PG_MAJOR |
| 6 | +ARG FANCY=1 |
| 7 | +ARG HLL_VERSION=2.18.citus-1 |
| 8 | +ARG TOPN_VERSION=2.6.0.citus-1 |
| 9 | + |
| 10 | +ENV CITUS_VERSION ${CITUS_VERSION} |
| 11 | + |
| 12 | +ENV PG_MAJOR ${PG_MAJOR} |
| 13 | + |
| 14 | +ENV TZ=Europe/Istanbul |
| 15 | +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
| 16 | + |
| 17 | +# install prequisities |
| 18 | +RUN apt-get update \ |
| 19 | + && apt-get install -y lsb-release \ |
| 20 | + apt-utils \ |
| 21 | + vim \ |
| 22 | + wget \ |
| 23 | + curl \ |
| 24 | + gnupg2 \ |
| 25 | + software-properties-common \ |
| 26 | + libcurl4-openssl-dev \ |
| 27 | + libssl-dev |
| 28 | + |
| 29 | + |
| 30 | +# install Citus |
| 31 | +RUN apt-get update \ |
| 32 | + && apt-get install -y --no-install-recommends \ |
| 33 | + ca-certificates \ |
| 34 | + curl \ |
| 35 | + && curl -s https://install.citusdata.com/community/deb.sh | bash |
| 36 | +RUN apt-get install -y postgresql-${PG_MAJOR}-citus-${CITUS_MAJOR_VERSION}=${CITUS_VERSION}.citus-${FANCY} \ |
| 37 | + postgresql-$PG_MAJOR-hll=${HLL_VERSION} \ |
| 38 | + postgresql-$PG_MAJOR-topn=${TOPN_VERSION} \ |
| 39 | + && apt-get purge -y --auto-remove curl \ |
| 40 | + && rm -rf /var/lib/apt/lists/*12 |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +ARG POSTGRES_HOME=/var/lib/postgresql/ |
| 45 | +ENV PATH=${PATH}:/usr/lib/postgresql/${PG_MAJOR}/bin:${POSTGRES_HOME} |
| 46 | + |
| 47 | +WORKDIR ${POSTGRES_HOME} |
| 48 | + |
| 49 | +RUN mkdir citus && chown postgres citus |
| 50 | + |
| 51 | +USER postgres |
| 52 | +RUN cd ~ && initdb -D citus && echo "shared_preload_libraries = 'citus'" >> citus/postgresql.conf |
| 53 | + |
| 54 | +USER root |
| 55 | +# Install python 3.8 and its dependencies |
| 56 | +RUN apt-get install -y build-essential \ |
| 57 | + libcurl4-openssl-dev \ |
| 58 | + libssl-dev \ |
| 59 | + zlib1g-dev \ |
| 60 | + curl \ |
| 61 | + libffi-dev \ |
| 62 | + gnupg2 && \ |
| 63 | + curl https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz --output Python-3.8.12.tgz &&\ |
| 64 | + tar xvf Python-3.8.12.tgz &&\ |
| 65 | + cd Python-3.8.*/ && \ |
| 66 | + ./configure --enable-optimizations && \ |
| 67 | + make altinstall && \ |
| 68 | + python3.8 -m pip install pip-tools |
| 69 | + |
| 70 | +COPY scripts/* ./ |
| 71 | + |
| 72 | +RUN pip-compile && python3.8 -m pip install -r requirements.txt |
| 73 | + |
| 74 | +USER postgres |
| 75 | + |
| 76 | +WORKDIR ${POSTGRES_HOME} |
| 77 | + |
| 78 | +CMD ["test_internal.sh"] |
0 commit comments