From 678fed4f442250cbcf32803bc0c494d270b5717e Mon Sep 17 00:00:00 2001 From: Tom Quist Date: Mon, 15 Jan 2024 22:42:39 +0100 Subject: [PATCH] docker: fix alpine-based image --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 98afebb..305b935 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,17 @@ ARG BASE=alpine FROM gcr.io/distroless/python3-debian12 AS base-distroless FROM python:3.11-alpine AS base-alpine -FROM debian:12-slim AS build +FROM debian:12-slim AS build-distroless RUN apt-get update && \ apt-get install --no-install-suggests --no-install-recommends --yes python3-venv gcc libpython3-dev && \ python3 -m venv /venv && \ /venv/bin/pip install --upgrade pip setuptools wheel -FROM build AS build-venv +FROM python:3.11-alpine AS build-alpine +RUN python3 -m venv /venv && \ + /venv/bin/pip install --upgrade pip setuptools wheel + +FROM build-${BASE} AS build-venv COPY requirements.txt /requirements.txt RUN /venv/bin/pip install --disable-pip-version-check -r /requirements.txt