From 5565c0efd7146b31f262fbe5977515cae0caa4b4 Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Mon, 25 Sep 2023 12:01:19 +0530 Subject: [PATCH 1/3] feat: optimise user image - Use python 3.11 for deployments - Remove unwanted dependencies --- user-image/Dockerfile | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/user-image/Dockerfile b/user-image/Dockerfile index d0d8f6533a..b9a27c9c59 100644 --- a/user-image/Dockerfile +++ b/user-image/Dockerfile @@ -1,36 +1,19 @@ -FROM ubuntu:22.04 +FROM python:3.11-slim -RUN apt-get update && apt-get upgrade -y -RUN apt-get install sudo git curl -y - -RUN adduser --disabled-password --gecos '' ubuntu -RUN adduser ubuntu sudo -RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers - -RUN apt install -y python3.10 python3.10-dev python3-pip libffi-dev -RUN pip3 install --upgrade pip -RUN pip3 install pipenv - -# utils -RUN apt install -y wget - -# golang -RUN wget https://dl.google.com/go/go1.13.8.linux-amd64.tar.gz && \ - tar -xzvf go1.13.8.linux-amd64.tar.gz -C /usr/local && \ - export PATH=$PATH:/usr/local/go/bin && echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && \ - mkdir $HOME/go - -USER ubuntu - -ENV PATH="${PATH}:/usr/local/go/bin" ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 +RUN apt update +RUN apt install -y python3.11-dev python3-pip -y +RUN apt autoremove +RUN apt autoclean + +RUN pip3 install --upgrade pip +RUN pip3 install "open-aea[all]==1.39.0.post1" open-aea-cli-ipfs==1.39.0.post1 + COPY user-image/openssl.cnf /etc/ssl -RUN echo 'PATH="$(python3.10 -m site --user-base)/bin:${PATH}"' >> ~/.bashrc -RUN echo "alias pip=pip3" >> ~/.bashrc -RUN echo "alias python=python3.10" >> ~/.bashrc +WORKDIR /root -ENTRYPOINT [ "/bin/bash"] +ENTRYPOINT ["/bin/bash", "-c"] From 6b0294414a8def8ac2eef17d5e7c700a33a06c12 Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Mon, 25 Sep 2023 12:09:39 +0530 Subject: [PATCH 2/3] chore: spell check fix --- .spelling | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.spelling b/.spelling index 8c0b795b72..2dcc0d3d22 100644 --- a/.spelling +++ b/.spelling @@ -377,4 +377,5 @@ plug-in cosmpy tomte pyyaml -1.36.0 \ No newline at end of file +1.36.0 +1.39.0.post1 \ No newline at end of file From 481660227fddb55c4f102f8e93da1850fba5ef7b Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Mon, 25 Sep 2023 16:44:36 +0530 Subject: [PATCH 3/3] fix: merge apt installation layers --- user-image/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/user-image/Dockerfile b/user-image/Dockerfile index b9a27c9c59..3f69c14f74 100644 --- a/user-image/Dockerfile +++ b/user-image/Dockerfile @@ -4,10 +4,7 @@ ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL C.UTF-8 ENV LANG C.UTF-8 -RUN apt update -RUN apt install -y python3.11-dev python3-pip -y -RUN apt autoremove -RUN apt autoclean +RUN apt update && apt install -y python3.11-dev python3-pip -y && apt autoremove && apt autoclean RUN pip3 install --upgrade pip RUN pip3 install "open-aea[all]==1.39.0.post1" open-aea-cli-ipfs==1.39.0.post1