11# BUILD STAGE ---------------------------------------
22# split this stage to save time and reduce image size
33# ---------------------------------------------------
4- FROM python:3.8-alpine3.11 as BuildStage
5- # update apk cache
6- RUN apk update
4+ FROM python:3.8-slim-bullseye as BuildStage
5+ # update apt
6+ RUN apt-get update
77# TODO: remove this when upgrading to a new alpine version
88# more details: https://github.com/pyca/cryptography/issues/5771
99ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
1010# install linux libraries necessary to compile some python packages
11- RUN apk add --update --no-cache --virtual .build-deps gcc git build-base alpine-sdk python3-dev musl-dev postgresql-dev libffi-dev libressl-dev
11+ # TODO ask asaf about postgres 11
12+ RUN apt-get install --fix-missing -y gcc git make python3-dev libpq-dev libffi-dev libssl-dev g++
1213# from now on, work in the /app directory
1314WORKDIR /app/
1415# Layer dependency install (for caching)
@@ -19,11 +20,13 @@ RUN pip install --upgrade pip && pip install --user -r requirements.txt
1920# MAIN IMAGE ----------------------------------------
2021# most of the time only this image should be built
2122# ---------------------------------------------------
22- FROM python:3.8-alpine3.11
23+ FROM python:3.8-slim-bullseye
24+ # update apt
25+ RUN apt-get update
2326# bash is needed for ./start/sh script
24- RUN apk add --update --no-cache bash curl
27+ RUN apt-get -y install curl
2528# needed for rookout
26- RUN apk add g++ python3-dev linux-headers
29+ RUN apt-get -y install --fix-missing gcc g++ python3-dev
2730# copy opa from official image (main binary and lib for web assembly)
2831RUN curl -L -o /opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64_static && chmod 755 /opa
2932# copy libraries from build stage
0 commit comments