簡體   English   中英

如何在 Dockerfile ubuntu 22.04 中將 pyjwt 從 2.3.0 更新到 2.4.0?

[英]How do i update pyjwt from 2.3.0 to 2.4.0 in Dockerfile ubuntu 22.04?

我們在基礎 docker 映像中發現 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 和更新 pyjwt package 與pip install pyjwt==2.4.0 但它沒有用。 似乎來自 Dockerfile 的上述 package 之一正在使用 pyjwt(2.3.0),我不知道如何更新它。

您可以嘗試使用apt卸載python3-jwt package 並使用 pip 安裝新版本

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM