From 13651d380e753cc34ba2f3af783d219cd38920d5 Mon Sep 17 00:00:00 2001 From: Fredrik Wrede Date: Tue, 21 Feb 2023 18:02:26 +0100 Subject: [PATCH 1/3] update dockerfile, use alpine --- Dockerfile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d093ce..b215425 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,14 @@ -FROM python:3.8.9 -COPY requirements.txt /app/ +FROM python:3.8.10-alpine as base +LABEL maintainer="fredrik@scaleoutsystems.com" WORKDIR /app -RUN pip install -e git+https://github.com/scaleoutsystems/fedn.git@develop#egg=fedn\&subdirectory=fedn -RUN pip install -r requirements.txt +COPY requirements.txt . +RUN apk add --update --no-cache \ + build-base \ + python3-dev \ + py3-setuptools \ + && pip install --no-cache-dir -r requirements.txt \ + && pip install -e git+https://github.com/scaleoutsystems/fedn.git@develop#egg=fedn\&subdirectory=fedn + + +FROM python:3.8.10-alpine as build +COPY --from=base /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ From 92292701f39a1ce64e17ca79fbced77851db3bc1 Mon Sep 17 00:00:00 2001 From: Fredrik Wrede Date: Wed, 22 Feb 2023 09:58:41 +0100 Subject: [PATCH 2/3] working progress --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b215425..cd1819a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,9 @@ RUN apk add --update --no-cache \ build-base \ python3-dev \ py3-setuptools \ - && pip install --no-cache-dir -r requirements.txt \ - && pip install -e git+https://github.com/scaleoutsystems/fedn.git@develop#egg=fedn\&subdirectory=fedn + git \ + && pip install -e git+https://github.com/scaleoutsystems/fedn.git@develop#egg=fedn\&subdirectory=fedn \ + && pip install --no-cache-dir -r requirements.txt FROM python:3.8.10-alpine as build From f175798506c0c317899b7cc101360ec4acbb50da Mon Sep 17 00:00:00 2001 From: Fredrik Wrede Date: Wed, 22 Feb 2023 13:40:07 +0100 Subject: [PATCH 3/3] use slim base image --- Dockerfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index cd1819a..4827450 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,14 @@ -FROM python:3.8.10-alpine as base -LABEL maintainer="fredrik@scaleoutsystems.com" +FROM python:3.10.6-slim as base +LABEL maintainer="salman@scaleoutsystems.com" WORKDIR /app COPY requirements.txt . -RUN apk add --update --no-cache \ - build-base \ - python3-dev \ - py3-setuptools \ - git \ +RUN apt-get update \ + && apt-get install --no-install-recommends -y git \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ && pip install -e git+https://github.com/scaleoutsystems/fedn.git@develop#egg=fedn\&subdirectory=fedn \ && pip install --no-cache-dir -r requirements.txt -FROM python:3.8.10-alpine as build -COPY --from=base /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/ +FROM python:3.10.6-slim as build +COPY --from=base /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/