@@ -13,55 +13,33 @@ SHELL ["/bin/bash", "-c"]
1313
1414# install deps
1515RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
16- apt-get update && apt-get -y install build-essential libreadline-dev zlib1g-dev \
17- flex bison libxml2-dev libxslt-dev libssl-dev \
18- libxml2-utils xsltproc ccache pkg-config wget \
19- curl lsb-release ca-certificates gnupg sudo git \
20- nano net-tools awscli libkrb5-dev python3.11 pip; \
16+ apt-get update && \
17+ apt-get -y install build-essential libreadline-dev zlib1g-dev flex bison \
18+ libxml2-dev libxslt-dev libssl-dev git libxml2-utils xsltproc \
19+ pkg-config wget curl sudo lsb-release ca-certificates gnupg \
20+ nano net-tools libkrb5-dev python3 python3-pip python3-venv \
21+ python3-dev && \
22+ apt install --only-upgrade python3-pip && \
23+ pip3 install pipx --break-system-packages; \
2124 fi
2225RUN if [ "${BASE_IMAGE_OS}" = "almalinux" ]; then \
2326 dnf -y update && \
2427 dnf -y install epel-release && \
25- dnf config-manager --enable crb && \
26- dnf -y install gcc gcc-c++ make readline-devel zlib-devel which \
27- flex bison libxml2-devel libxslt-devel openssl-devel \
28- ccache pkgconfig wget lsb_release ca-certificates \
29- gnupg sudo git nano net-tools awscli krb5-devel \
30- python3.11 pip; \
31- fi
32-
33- # Upgrade pip and uv
34- RUN if [ "$BASE_IMAGE_OS" = "almalinux" ]; then \
35- python3.11 -m ensurepip --upgrade && \
36- python3.11 -m pip install --upgrade pip && \
37- python3.11 -m pip install uv; \
38- fi
39- RUN if [ "$BASE_IMAGE_OS" = "debian" ]; then \
40- python3.11 -m pip install --upgrade pip --break-system-packages && \
41- python3.11 -m pip install uv --break-system-packages; \
42- fi
43-
44- ENV PATH="~/.local/bin:$PATH"
45-
46- # Install uv (we run mitmproxy with it)
47- RUN curl -LsSf https://astral.sh/uv/install.sh | sh
48-
49- # install azure-cli
50- RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
51- curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null && \
52- echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ `lsb_release -cs` main" | tee /etc/apt/sources.list.d/azure-cli.list && \
53- apt-get update && apt-get install -y azure-cli; \
54- fi
55- RUN if [ "${BASE_IMAGE_OS}" = "almalinux" ]; then \
56- rpm --import https://packages.microsoft.com/keys/microsoft.asc && \
57- dnf install -y https://packages.microsoft.com/config/rhel/${BASE_IMAGE_OS_VERSION}/packages-microsoft-prod.rpm && \
58- dnf install -y azure-cli; \
28+ (dnf config-manager --set-enabled powertools || true) && \
29+ (dnf config-manager --set-enabled crb || true) && \
30+ dnf -y install gcc gcc-c++ make readline-devel zlib-devel flex bison libxml2-devel \
31+ libxslt-devel openssl-devel pkgconfig wget ca-certificates sudo git \
32+ which gnupg nano net-tools krb5-devel python3 python3-pip \
33+ platform-python-devel && \
34+ pip3 install --upgrade pip && \
35+ pip3 install pipx; \
5936 fi
6037
6138# install Postgres
6239RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
63- sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
64- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
40+ wget -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > postgresql-keyring.gpg && \
41+ cat postgresql-keyring.gpg | sudo tee -a /usr/share/keyrings/postgresql-keyring.gpg > /dev/null && \
42+ sh -c 'echo "deb [signed-by=/usr/share/keyrings/postgresql-keyring.gpg] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
6543 apt-get update && apt-get -y install postgresql-{14,15,16,17,18}-postgis-3 \
6644 postgresql-{14,15,16,17,18}-pgaudit \
6745 postgresql-server-dev-{14,15,16,17,18} \
@@ -71,7 +49,7 @@ RUN if [ "${BASE_IMAGE_OS}" = "debian" ]; then \
7149RUN if [ "${BASE_IMAGE_OS}" = "almalinux" ]; then \
7250 ARCH=$(uname -m) && \
7351 dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-${ARCH}/pgdg-redhat-repo-latest.noarch.rpm && \
74- dnf -qy module disable postgresql && \
52+ ( dnf -qy module disable postgresql || true) && \
7553 dnf install -y --nogpgcheck \
7654 postgis36_{14,15,16,17,18} \
7755 pgaudit{16_14,17_15,_16,_17,_18} \
@@ -142,6 +120,10 @@ RUN echo "$USERNAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USERNAME
142120
143121USER $USERNAME
144122
123+ # Install awscli, azure-cli and mitmdump with rust user
124+ RUN pipx install mitmproxy && pipx install awscli && pipx install azure-cli
125+ ENV PATH="~/.local/bin:${PATH}"
126+
145127# install Rust environment
146128ARG RUSTC_VERSION=1.90.0
147129RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
0 commit comments