Skip to content

Commit 2c3aa85

Browse files
authored
fix(docker image security): Improve dependency pinning and disable ability to build image from different tag from what specified in Dockefile (antonbabenko#830)
1 parent 8c1c83d commit 2c3aa85

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
python -m
186186
pip install
187187
--user
188-
setuptools-scm
188+
setuptools-scm~=8.2
189189
shell: bash
190190
- name: Set the current dist version from Git
191191
id: scm-version

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
ARG TAG=3.12.0-alpine3.17@sha256:fc34b07ec97a4f288bc17083d288374a803dd59800399c76b977016c9fe5b8f2
2-
FROM python:${TAG} as builder
1+
FROM python:3.12.0-alpine3.17@sha256:fc34b07ec97a4f288bc17083d288374a803dd59800399c76b977016c9fe5b8f2 AS python_base
2+
3+
FROM python_base AS builder
34
ARG TARGETOS
45
ARG TARGETARCH
56

@@ -11,8 +12,8 @@ RUN apk add --no-cache \
1112
curl=~8 && \
1213
# Upgrade packages for be able get latest Checkov
1314
python3 -m pip install --no-cache-dir --upgrade \
14-
pip \
15-
setuptools
15+
pip~=25.0 \
16+
setuptools~=75.8
1617

1718
COPY tools/install/ /install/
1819

@@ -100,7 +101,7 @@ RUN . /.env && \
100101

101102

102103

103-
FROM python:${TAG}
104+
FROM python_base
104105

105106
RUN apk add --no-cache \
106107
# pre-commit deps

0 commit comments

Comments
 (0)