Kubeflow Adapter module docker file optimisation 81/13781/2
authorMonosij Ghosh <mono.ghosh@samsung.com>
Tue, 26 Nov 2024 09:20:39 +0000 (14:50 +0530)
committerMonosij Ghosh <mono.ghosh@samsung.com>
Tue, 26 Nov 2024 11:12:29 +0000 (16:42 +0530)
Memmory optimisation for docker image

Change-Id: I33a74b159b18297c88ff3821b852009c8fc7ad1a
Signed-off-by: Monosij Ghosh <mono.ghosh@samsung.com>
.dockerignore [new file with mode: 0644]
Dockerfile

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..8839a47
--- /dev/null
@@ -0,0 +1,5 @@
+.git
+*.log
+__pycache__/
+*.pyc
+*.pyo
index a17ffb1..ed78ce2 100644 (file)
 FROM ubuntu:22.04
 
 # location in the container
-ENV TA_DIR /home/app/
+ENV TA_DIR=/home/app/
+WORKDIR ${TA_DIR}
 
 # Install dependencies
-RUN apt-get update && apt-get install -y \
-    python3 && apt-get install -y \
-    python3-pip
-WORKDIR ${TA_DIR}
+RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/*
 
 # Copy sources into the container
 COPY . .
 
 #Install the pip3 requirements
-RUN pip3 install .
-RUN pip3 install -r requirements.txt
-RUN pip3 install requests-toolbelt==0.10.1
+RUN pip3 install --no-cache-dir -r requirements.txt requests-toolbelt==0.10.1 .
 
 #Expose the ports
 EXPOSE 5000