From 5d5d8a487d211d2a467c8de931098377a3b9628f Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 27 Nov 2024 18:54:50 +0530 Subject: [PATCH 1/2] Dockerfile update --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9b9c6a4c7..567130a2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.20.2 +FROM python:3.12-alpine LABEL net.juniper.description="Junos PyEZ library for Python in a lightweight container." \ net.juniper.maintainer="jnpr-community-netdev@juniper.net" @@ -12,15 +12,12 @@ ADD requirements.txt . ADD lib lib ADD entrypoint.sh /usr/local/bin/. -## Install dependencies +## Install dependancies and PyEZ RUN apk add --no-cache build-base python3-dev \ libxslt-dev libxml2-dev libffi-dev openssl-dev curl \ ca-certificates py3-pip bash -## Update as per PEP 668. Use Virtual Env -RUN python3 -m venv /scripts/.venv \ - && source /scripts/.venv/bin/activate \ - && pip install --upgrade pip \ +RUN pip install --upgrade pip \ && pip install pipdeptree \ && python3 -m pip install -r requirements.txt \ && pip install . From baadb7c005d7a7b66ec5bd298984a86608a1be06 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 27 Nov 2024 19:02:55 +0530 Subject: [PATCH 2/2] Dockerfile update --- entrypoint.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index af403b5f7..ecf2b2fbc 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -18,8 +18,11 @@ function pip_install { } function run_scripts { - echo "Executing defined script" - python3 $1 ${@:2} + if [ "$1" = "python3" ] || [ "$1" = "python" ]; then python3 + else + echo "Executing defined script" + $1 ${@:2} + fi } ## Manually defined variables will take precedence