如何在Dockerfile Ubuntu 22.04中将PYJWT从2.3.0更新为2.4.0?

发布于 2025-02-05 07:37:00 字数 1381 浏览 2 评论 0原文

我们在基本Docker Image中发现了1个漏洞“ Pyjwt版本2.3.0具有1个漏洞”,以下版本Pyjwt 2.4.0在

下面的版本中是dockerfile,

FROM ubuntu:22.04

# hadolint ignore=DL3015
# hadolint ignore=DL3008
RUN apt-get clean
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update

RUN apt-get -y upgrade apt \
    && apt-get install -y unoconv ghostscript software-properties-common \
    && add-apt-repository ppa:ondrej/php -y \
    && apt -y install php7.4 \
    && apt-get install -y curl jq php7.4-bcmath php7.4-xml zip unzip php7.4-zip \
    && apt-get install -y php7.4-fpm php7.4-amqp composer nginx openssl php7.4-curl ca-certificates \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
    && unzip awscliv2.zip \
    && ./aws/install \
    && rm awscliv2.zip

# Setup services
COPY ./src/scripts/nginx.conf   /etc/nginx/nginx.conf
COPY ./src/scripts/run.sh       /opt/run.sh
RUN chmod -R a+rw /etc/nginx
RUN chmod -R a+rw /etc/php/7.4/fpm
RUN chmod +x      /opt/run.sh

EXPOSE 8080 8443

CMD [ "/opt/run.sh" ]

我尝试了许多事情,例如更新安装python3并使用pip pip install pip pip install = pip pip install = pip pip install = pip pip install = = 2.4.0。但这无效。似乎来自Dockerfile的上述软件包之一是使用Pyjwt(2.3.0),我不知道该如何更新它。

We found 1 vulnerability in base docker image "pyjwt version 2.3.0 has 1 vulnerability" Fixed in version pyjwt 2.4.0

Below is the Dockerfile

FROM ubuntu:22.04

# hadolint ignore=DL3015
# hadolint ignore=DL3008
RUN apt-get clean
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update

RUN apt-get -y upgrade apt \
    && apt-get install -y unoconv ghostscript software-properties-common \
    && add-apt-repository ppa:ondrej/php -y \
    && apt -y install php7.4 \
    && apt-get install -y curl jq php7.4-bcmath php7.4-xml zip unzip php7.4-zip \
    && apt-get install -y php7.4-fpm php7.4-amqp composer nginx openssl php7.4-curl ca-certificates \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
    && unzip awscliv2.zip \
    && ./aws/install \
    && rm awscliv2.zip

# Setup services
COPY ./src/scripts/nginx.conf   /etc/nginx/nginx.conf
COPY ./src/scripts/run.sh       /opt/run.sh
RUN chmod -R a+rw /etc/nginx
RUN chmod -R a+rw /etc/php/7.4/fpm
RUN chmod +x      /opt/run.sh

EXPOSE 8080 8443

CMD [ "/opt/run.sh" ]

I have tried many things like update installing python3 and updating pyjwt package with pip install pyjwt==2.4.0. But it didn't work. It seems like one of the above package from Dockerfile is using pyjwt(2.3.0) and I don't know how do i update it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉睡月亮 2025-02-12 07:37:00

您可以尝试使用 apt 的卸载 python3-jwt 软件包,并使用pip安装新版本

RUN apt purge --autoremove python3-jwt -y
RUN pip3 install PyJWT==2.4.0

You can try uninstall python3-jwt package with apt and install new version with pip

RUN apt purge --autoremove python3-jwt -y
RUN pip3 install PyJWT==2.4.0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文