Skip to content

Commit 6197afa

Browse files
Merge pull request #14 from DNXLabs/adding_3.12
Adding version 3.12 support, remove support to deprecated versions, u…
2 parents b4f853f + 9f9dbbc commit 6197afa

File tree

11 files changed

+138
-184
lines changed

11 files changed

+138
-184
lines changed

.github/workflows/security.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v1
12+
- uses: actions/checkout@v4
1313

1414
- name: Set tag var
1515
id: vars
16-
run: echo ::set-output name=docker_tag::$(echo ${GITHUB_REF} | cut -d'/' -f3)-${GITHUB_SHA}
16+
run: echo "docker_tag=$(echo ${GITHUB_REF} | cut -d'/' -f3)-${GITHUB_SHA}" >> $GITHUB_OUTPUT
1717

1818
- name: Build the Docker image
19-
run: docker build . --file ./3.8/Dockerfile --tag docker-terraform:${{ steps.vars.outputs.docker_tag }}
19+
run: docker build . --file ./3.12/Dockerfile --tag serverless-python:${{ steps.vars.outputs.docker_tag }}
2020

21-
- name: Scan with Phonito Security
22-
uses: phonito/phonito-scanner-action@master
21+
- name: Run Trivy vulnerability scanner
22+
uses: aquasecurity/trivy-action@master
2323
with:
24-
image: docker-terraform:${{ steps.vars.outputs.docker_tag }}
25-
phonito-token: ${{ secrets.PHONITO_TOKEN }}
24+
image-ref: serverless-python:${{ steps.vars.outputs.docker_tag }}
25+
format: 'sarif'
26+
output: 'trivy-results.sarif'
27+
28+
- name: Upload Trivy scan results to GitHub Security tab
29+
uses: github/codeql-action/upload-sarif@v3
30+
if: always()
31+
with:
32+
sarif_file: 'trivy-results.sarif'

3.10/Dockerfile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
FROM python:3.10-slim-buster
1+
FROM python:3.10-slim-bookworm
22

33
RUN apt-get update && \
44
apt-get install -y \
5-
wget=1.20.1-1.1 \
6-
zip=3.0-11+b1 \
7-
unzip=6.0-23+deb10u2 \
8-
git=1:2.20.1-2+deb10u3 \
5+
wget \
6+
zip \
7+
unzip \
8+
git \
99
curl \
10-
npm=5.8.0+ds6-4+deb10u2 && \
11-
pip3 install --no-cache-dir --upgrade pip==23.3.1 && \
12-
npm install [email protected] -g && \
13-
npm install -g [email protected] && \
14-
npm install -g [email protected] &&\
10+
ca-certificates \
11+
gnupg && \
12+
pip3 install --no-cache-dir --upgrade pip==25.1.1 && \
1513
apt-get -q -y clean && \
1614
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
1715

18-
ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
19-
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash
20-
RUN apt-get install -y nodejs
16+
RUN mkdir -p /etc/apt/keyrings && \
17+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
18+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
19+
apt-get update && \
20+
apt-get install -y nodejs && \
21+
npm install -g [email protected] && \
22+
npm install -g [email protected] && \
23+
apt-get -q -y clean && \
24+
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
2125

2226
WORKDIR /work
2327

3.11/Dockerfile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
FROM python:3.11-slim-buster
1+
FROM python:3.11-slim-bookworm
22

33
RUN apt-get update && \
44
apt-get install -y \
5-
wget=1.20.1-1.1 \
6-
zip=3.0-11+b1 \
7-
unzip=6.0-23+deb10u2 \
8-
git=1:2.20.1-2+deb10u3 \
5+
wget \
6+
zip \
7+
unzip \
8+
git \
99
curl \
10-
npm=5.8.0+ds6-4+deb10u2 && \
11-
pip3 install --no-cache-dir --upgrade pip==23.3.1 && \
12-
npm install [email protected] -g && \
13-
npm install -g [email protected] && \
14-
npm install -g [email protected] &&\
10+
ca-certificates \
11+
gnupg && \
12+
pip3 install --no-cache-dir --upgrade pip==25.1.1 && \
1513
apt-get -q -y clean && \
1614
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
1715

18-
ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
19-
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash
20-
RUN apt-get install -y nodejs
16+
RUN mkdir -p /etc/apt/keyrings && \
17+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
18+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
19+
apt-get update && \
20+
apt-get install -y nodejs && \
21+
npm install -g [email protected] && \
22+
npm install -g [email protected] && \
23+
apt-get -q -y clean && \
24+
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
2125

2226
WORKDIR /work
2327

3.12/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM python:3.12-slim-bookworm
2+
3+
RUN apt-get update && \
4+
apt-get install -y \
5+
wget \
6+
zip \
7+
unzip \
8+
git \
9+
curl \
10+
ca-certificates \
11+
gnupg && \
12+
pip3 install --no-cache-dir --upgrade pip==25.1.1 && \
13+
apt-get -q -y clean && \
14+
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
15+
16+
RUN mkdir -p /etc/apt/keyrings && \
17+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
18+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
19+
apt-get update && \
20+
apt-get install -y nodejs && \
21+
npm install -g [email protected] && \
22+
npm install -g [email protected] && \
23+
apt-get -q -y clean && \
24+
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
25+
26+
WORKDIR /work
27+
28+
ENTRYPOINT ["/bin/sh"]

3.6/Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

3.7/Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

3.8/Dockerfile

Lines changed: 0 additions & 24 deletions
This file was deleted.

3.8/hadolint.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

3.9/Dockerfile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
FROM python:3.9-slim-buster
1+
FROM python:3.9-slim-bookworm
22

33
RUN apt-get update && \
44
apt-get install -y \
5-
wget=1.20.1-1.1 \
6-
zip=3.0-11+b1 \
7-
unzip=6.0-23+deb10u2 \
8-
git=1:2.20.1-2+deb10u3 \
5+
wget \
6+
zip \
7+
unzip \
8+
git \
99
curl \
10-
npm=5.8.0+ds6-4+deb10u2 && \
11-
pip3 install --no-cache-dir --upgrade pip==23.3.1 && \
12-
npm install [email protected] -g && \
13-
npm install -g [email protected] && \
14-
npm install -g [email protected] &&\
10+
ca-certificates \
11+
gnupg && \
12+
pip3 install --no-cache-dir --upgrade pip==25.1.1 && \
1513
apt-get -q -y clean && \
1614
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
1715

18-
ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
19-
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash
20-
RUN apt-get install -y nodejs
16+
RUN mkdir -p /etc/apt/keyrings && \
17+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
18+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
19+
apt-get update && \
20+
apt-get install -y nodejs && \
21+
npm install -g [email protected] && \
22+
npm install -g [email protected] && \
23+
apt-get -q -y clean && \
24+
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
2125

2226

2327
WORKDIR /work

Makefile

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,40 @@
22
build:
33
echo "Build specific tag/release"
44

5-
# Python 3.6
6-
docker build \
7-
--build-arg base_image=python:3.6-slim \
8-
-t ${REPO}:3.6-${IMAGE_TAG} \
9-
./3.6/.
10-
11-
# Python 3.7
12-
docker build \
13-
--build-arg base_image=python:3.7-slim \
14-
-t ${REPO}:3.7-${IMAGE_TAG} \
15-
./3.7/.
16-
17-
# Python 3.8
18-
docker build \
19-
--build-arg base_image=python:3.8-slim \
20-
-t ${REPO}:3.8-${IMAGE_TAG} \
21-
./3.8/.
22-
235
# Python 3.9
246
docker build \
25-
--build-arg base_image=python:3.9-slim \
7+
--build-arg base_image=python:3.9-slim-bookworm \
268
-t ${REPO}:3.9-${IMAGE_TAG} \
279
./3.9/.
2810

2911
# Python 3.10
3012
docker build \
31-
--build-arg base_image=python:3.10-slim \
13+
--build-arg base_image=python:3.10-slim-bookworm \
3214
-t ${REPO}:3.10-${IMAGE_TAG} \
3315
./3.10/.
3416

3517
# Python 3.11
3618
docker build \
37-
--build-arg base_image=python:3.11-slim \
19+
--build-arg base_image=python:3.11-slim-bookworm \
3820
-t ${REPO}:3.11-${IMAGE_TAG} \
3921
./3.11/.
4022

23+
# Python 3.12
24+
docker build \
25+
--build-arg base_image=python:3.12-slim-bookworm \
26+
-t ${REPO}:3.12-${IMAGE_TAG} \
27+
./3.12/.
4128
push:
4229
echo "Push specific tag/release"
4330

44-
# Python 3.6
45-
docker push ${REPO}:3.6-${IMAGE_TAG}
46-
47-
# Python 3.7
48-
docker push ${REPO}:3.7-${IMAGE_TAG}
49-
50-
# Python 3.8
51-
docker push ${REPO}:3.8-${IMAGE_TAG}
52-
5331
# Python 3.9
5432
docker push ${REPO}:3.9-${IMAGE_TAG}
5533

5634
# Python 3.10
5735
docker push ${REPO}:3.10-${IMAGE_TAG}
5836

5937
# Python 3.11
60-
docker push ${REPO}:3.11-${IMAGE_TAG}
38+
docker push ${REPO}:3.11-${IMAGE_TAG}
39+
40+
# Python 3.12
41+
docker push ${REPO}:3.12-${IMAGE_TAG}

0 commit comments

Comments
 (0)