From d7a4fe8624d15141163f1065085643f855f25907 Mon Sep 17 00:00:00 2001 From: aleksandrtverdikov Date: Thu, 16 May 2024 11:24:53 -0400 Subject: [PATCH] Update versions in Dockerfiles --- docker/aws-eks-utils/Dockerfile | 63 ++++++++++++-------- docker/postgresql-backups/Dockerfile | 14 ++--- docker/postgresql-exporter-script/Dockerfile | 2 +- 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/docker/aws-eks-utils/Dockerfile b/docker/aws-eks-utils/Dockerfile index 5bcd9347..c77eb353 100644 --- a/docker/aws-eks-utils/Dockerfile +++ b/docker/aws-eks-utils/Dockerfile @@ -1,25 +1,27 @@ -FROM public.ecr.aws/docker/library/alpine:3.15.4 +FROM public.ecr.aws/docker/library/ubuntu:22.04 as sessionmanagerplugin -ARG TERRAFORM_VERSION="1.1.8" -ARG TERRAGRUNT_VERSION="0.39.1" -ARG HELM_VERSION="3.8.2" +RUN apt-get update \ + && apt-get install -y curl \ + && curl -Lo "session-manager-plugin.deb" "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" \ + && dpkg -i "session-manager-plugin.deb" + +FROM public.ecr.aws/docker/library/alpine:3.19.1 + +ARG TERRAFORM_VERSION="1.8.3" +ARG TERRAGRUNT_VERSION="0.58.5" +ARG HELM_VERSION="3.15.0" ARG HELMFILE_VERSION="0.144.0" -ARG KUBECTL_VERSION="1.22.0" +ARG KUBECTL_VERSION="1.30.1" ENV BASE_URL="https://get.helm.sh" ENV TAR_FILE="helm-v${HELM_VERSION}-linux-amd64.tar.gz" #Install python and pip -RUN echo "**** install Python ****" && \ - apk add --no-cache python3 && \ - if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \ - \ - echo "**** install pip ****" && \ - python3 -m ensurepip && \ - pip3 install --no-cache --upgrade pip setuptools wheel && \ - if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi +RUN echo "**** install Python and pip ****" && \ + apk add --update --no-cache python3 py3-pip py3-setuptools py3-wheel #Install additional packages and helm -RUN apk add --update --no-cache openssl git jq bash curl wget unzip ca-certificates && \ +RUN echo "**** install additional packages and helm ****" && \ + apk add --update --no-cache openssl git jq bash curl wget unzip ca-certificates && \ curl -L ${BASE_URL}/${TAR_FILE} |tar xvz && \ mv linux-amd64/helm /usr/bin/helm && \ chmod +x /usr/bin/helm @@ -27,34 +29,47 @@ RUN apk add --update --no-cache openssl git jq bash curl wget unzip ca-certifica WORKDIR /tmp #Install tfenv for terraform -RUN git clone https://github.com/tfutils/tfenv.git /usr/bin/.tfenv && \ +RUN echo "**** install tfenv for terraform ****" && \ + git clone https://github.com/tfutils/tfenv.git /usr/bin/.tfenv && \ ln -s /usr/bin/.tfenv/bin/* /usr/bin #Intall tgenv for terragrunt -RUN git clone https://github.com/cunymatthieu/tgenv.git /usr/bin/.tgenv && \ +RUN echo "**** install tgenv for terragrunt ****" && \ + git clone https://github.com/cunymatthieu/tgenv.git /usr/bin/.tgenv && \ ln -s /usr/bin/.tgenv/bin/* /usr/bin #Install terraform -RUN tfenv install $TERRAFORM_VERSION +RUN echo "**** install terraform ****" && \ + tfenv install $TERRAFORM_VERSION #Install terragrunt -RUN tgenv install $TERRAGRUNT_VERSION +RUN echo "**** install terragrunt ****" && \ + tgenv install $TERRAGRUNT_VERSION #Install aws-cli -RUN pip install awscli --upgrade +RUN echo "**** install aws-cli ****" && \ + pip install awscli --upgrade --break-system-packages + +#Install aws session-manager plugin for cli +RUN echo "**** install aws session manager plugin for cli ****" +COPY --from=sessionmanagerplugin /usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/local/bin/ #Install kubectl -RUN wget https://storage.googleapis.com/kubernetes-release/release/v"$KUBECTL_VERSION"/bin/linux/amd64/kubectl \ - && chmod +x kubectl && mv kubectl /bin/kubectl +RUN echo "**** install kubectl ****" && \ + wget https://storage.googleapis.com/kubernetes-release/release/v"$KUBECTL_VERSION"/bin/linux/amd64/kubectl && \ + chmod +x kubectl && mv kubectl /bin/kubectl #Install docker -RUN apk add --no-cache --update docker +RUN echo "**** install docker ****" && \ + apk add --no-cache --update docker #Install helmfile -RUN wget https://github.com/roboll/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_linux_amd64 \ +RUN echo "**** install helmfile ****" && \ + wget https://github.com/roboll/helmfile/releases/download/v${HELMFILE_VERSION}/helmfile_linux_amd64 \ && chmod +x helmfile_linux_amd64 && mv helmfile_linux_amd64 /bin/helmfile # Install ssh -RUN apk add openssh +RUN echo "**** install openssh ****" && \ + apk add openssh ENTRYPOINT [""] diff --git a/docker/postgresql-backups/Dockerfile b/docker/postgresql-backups/Dockerfile index 00adb386..8e634f42 100644 --- a/docker/postgresql-backups/Dockerfile +++ b/docker/postgresql-backups/Dockerfile @@ -1,18 +1,12 @@ -FROM public.ecr.aws/docker/library/postgres:12-alpine +FROM public.ecr.aws/docker/library/postgres:16-alpine #Install python and pip -RUN echo "**** install Python ****" && \ - apk add --no-cache python3 && \ - if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \ - \ - echo "**** install pip ****" && \ - python3 -m ensurepip && \ - pip3 install --no-cache --upgrade pip setuptools wheel && \ - if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi +RUN echo "**** install Python and pip ****" && \ + apk add --update --no-cache python3 py3-pip py3-setuptools py3-wheel COPY requirements.txt . -RUN pip install --upgrade --no-cache-dir -r requirements.txt +RUN pip install --upgrade --no-cache-dir --break-system-packages -r requirements.txt COPY backup.py . diff --git a/docker/postgresql-exporter-script/Dockerfile b/docker/postgresql-exporter-script/Dockerfile index 9efab53f..286b75b0 100644 --- a/docker/postgresql-exporter-script/Dockerfile +++ b/docker/postgresql-exporter-script/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/docker/library/postgres:12-alpine +FROM public.ecr.aws/docker/library/postgres:16-alpine WORKDIR /app