From 6d28a7a24bbb396ff688a39667ed6f13311fd3cc Mon Sep 17 00:00:00 2001 From: Jan Heinrich Reimer Date: Tue, 5 Mar 2024 12:37:44 +0100 Subject: [PATCH 1/3] Simplify Dockerfile Signed-off-by: Jan Heinrich Reimer --- Dockerfile | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8bec6c8a..4d74686a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,8 @@ -FROM ubuntu:22.04 +FROM python:3.10-slim -ENV DEBIAN_FRONTEND=noninteractive RUN \ --mount=type=cache,target=/var/cache/apt \ - apt-get update -y && \ - apt-get upgrade -y -RUN \ - --mount=type=cache,target=/var/cache/apt \ - apt-get install -y software-properties-common && \ - add-apt-repository -y ppa:deadsnakes/ppa -RUN \ - --mount=type=cache,target=/var/cache/apt \ - apt-get install -y python3.10 python3.10-dev python3.10-venv git build-essential zlib1g-dev protobuf-compiler + apt-get install -y git build-essential zlib1g-dev protobuf-compiler RUN \ --mount=type=cache,target=/root/.cache/pip \ @@ -33,4 +24,4 @@ RUN \ ADD . . -ENTRYPOINT ["/venv/bin/python", "-m", "archive_query_log"] \ No newline at end of file +ENTRYPOINT ["/venv/bin/python", "-m", "archive_query_log"] From 2bfb832a8bc644fb029e40b73d46c340335f792a Mon Sep 17 00:00:00 2001 From: Jan Heinrich Reimer Date: Tue, 5 Mar 2024 12:39:53 +0100 Subject: [PATCH 2/3] Update Dockerfile Signed-off-by: Jan Heinrich Reimer --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4d74686a..cae730df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,8 @@ FROM python:3.10-slim RUN \ --mount=type=cache,target=/var/cache/apt \ - apt-get install -y git build-essential zlib1g-dev protobuf-compiler + apt-get -y update && + apt-get -y install git build-essential zlib1g-dev protobuf-compiler RUN \ --mount=type=cache,target=/root/.cache/pip \ From 0d613704e3428cf174e174e1615ef68f57787bbf Mon Sep 17 00:00:00 2001 From: Jan Heinrich Reimer Date: Tue, 5 Mar 2024 12:45:21 +0100 Subject: [PATCH 3/3] Update Dockerfile Signed-off-by: Jan Heinrich Reimer --- Dockerfile | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index cae730df..55816d1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,20 @@ FROM python:3.10-slim -RUN \ - --mount=type=cache,target=/var/cache/apt \ - apt-get -y update && +RUN --mount=type=cache,target=/var/cache/apt \ + apt-get -y update && \ apt-get -y install git build-essential zlib1g-dev protobuf-compiler -RUN \ - --mount=type=cache,target=/root/.cache/pip \ +RUN --mount=type=cache,target=/root/.cache/pip \ ([ -d /venv ] || python3.10 -m venv /venv) && \ /venv/bin/pip install --upgrade pip WORKDIR /workspace/ ADD pyproject.toml pyproject.toml ARG PSEUDO_VERSION=1 -RUN \ - --mount=type=cache,target=/root/.cache/pip \ +RUN --mount=type=cache,target=/root/.cache/pip \ SETUPTOOLS_SCM_PRETEND_VERSION=${PSEUDO_VERSION} \ /venv/bin/pip install -e . - -RUN \ - --mount=source=.git,target=.git,type=bind \ +RUN --mount=source=.git,target=.git,type=bind \ --mount=type=cache,target=/root/.cache/pip \ /venv/bin/pip install -e .