Adrian Gil Moral
Adrian Gil Moral

Reputation: 13

Update setuptools on Docker

I am trying to update setuptools on my Dockerfile in order to solve the vulnerability CVE-2022-40897.

However, when going to the Jfrog of the project, with neither of them appears the setuptools with a higher version than when neither of these options is followed.

I have tried the following options:

  1. RUN apk add --upgrade py3-setuptools
  2. RUN apk upgrade --no-cache py3-setuptools
  3. RUN python -m ensurepip RUN pip install --no-cache --upgrade pip setuptools

Any ideas of how can I force setuptools to be updated on the Dockerfile?

Upvotes: 1

Views: 4440

Answers (1)

James Apple
James Apple

Reputation: 246

The vulnerability is fixed in setuptools version 65.5.1. To specify the new version of setuptools in your Dockerfile, include the following:

RUN pip install setuptools>=65.5.1

Alternatively, if your project contains a "requirements.txt" file, then you can add the following line to that file: setuptools>=65.5.1

Upvotes: 3

Related Questions