From ad51a9ebc85911e2db771c2d2eff80c27d1f78c4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 10 May 2022 11:10:58 +0200 Subject: [PATCH] feat: Python image selection --- src/lib/buildPacks/common.ts | 84 +++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/src/lib/buildPacks/common.ts b/src/lib/buildPacks/common.ts index cb47b0dd5..588af6181 100644 --- a/src/lib/buildPacks/common.ts +++ b/src/lib/buildPacks/common.ts @@ -405,7 +405,88 @@ export function setDefaultBaseImage(buildPack) { label: 'webdevops/php-nginx:7.1-alpine' } ]; - + const pythonVersions = [ + { + value: 'python:3.11-alpine', + label: 'python:3.11-alpine' + }, + { + value: 'python:3.11-buster', + label: 'python:3.11-buster' + }, + { + value: 'python:3.11-bullseye', + label: 'python:3.11-bullseye' + }, + { + value: 'python:3.11-slim-bullseye', + label: 'python:3.11-slim-bullseye' + }, + { + value: 'python:3.11-alpine', + label: 'python:3.11-alpine' + }, + { + value: 'python:3.10-buster', + label: 'python:3.10-buster' + }, + { + value: 'python:3.10-bullseye', + label: 'python:3.10-bullseye' + }, + { + value: 'python:3.10-slim-bullseye', + label: 'python:3.10-slim-bullseye' + }, + { + value: 'python:3.9-alpine', + label: 'python:3.9-alpine' + }, + { + value: 'python:3.9-buster', + label: 'python:3.9-buster' + }, + { + value: 'python:3.9-bullseye', + label: 'python:3.9-bullseye' + }, + { + value: 'python:3.9-slim-bullseye', + label: 'python:3.9-slim-bullseye' + }, + { + value: 'python:3.8-alpine', + label: 'python:3.8-alpine' + }, + { + value: 'python:3.8-buster', + label: 'python:3.8-buster' + }, + { + value: 'python:3.8-bullseye', + label: 'python:3.8-bullseye' + }, + { + value: 'python:3.8-slim-bullseye', + label: 'python:3.8-slim-bullseye' + }, + { + value: 'python:3.7-alpine', + label: 'python:3.7-alpine' + }, + { + value: 'python:3.7-buster', + label: 'python:3.7-buster' + }, + { + value: 'python:3.7-bullseye', + label: 'python:3.7-bullseye' + }, + { + value: 'python:3.7-slim-bullseye', + label: 'python:3.7-slim-bullseye' + } + ]; let payload = { baseImage: null, baseBuildImage: null, @@ -426,6 +507,7 @@ export function setDefaultBaseImage(buildPack) { } if (buildPack === 'python') { payload.baseImage = 'python:3-alpine'; + payload.baseImages = pythonVersions; } if (buildPack === 'rust') { payload.baseImage = 'rust:latest';