From 06c5ee558a370cd9c0382dafd97fa6eee67a8fbb Mon Sep 17 00:00:00 2001 From: Eero Tamminen Date: Wed, 8 Jan 2025 16:14:00 +0200 Subject: [PATCH] Get security updates & parametrize base image name And fix hadolint warning. Signed-off-by: Eero Tamminen --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e94d1bab1f..482454a4e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,14 @@ # Base image for GenAIComps based OPEA Python applications # Build: docker build -t opea/comps-base -f Dockerfile . -FROM python:3.11-slim +ARG IMAGE_NAME=python +ARG IMAGE_TAG=3.11-slim -RUN apt-get update +FROM ${IMAGE_NAME}:${IMAGE_TAG} AS base + +# get security updates +#RUN apt-get update && apt-get upgrade -y && \ +# apt-get clean && rm -rf /var/lib/apt/lists/* ENV HOME=/home/user @@ -16,7 +21,7 @@ RUN useradd -m -s /bin/bash user && \ WORKDIR $HOME -COPY *.toml *.py *.txt *.md LICENSE . +COPY *.toml *.py *.txt *.md LICENSE ./ RUN pip install --no-cache-dir --upgrade pip setuptools && \ pip install --no-cache-dir -r requirements.txt