Python Dockerfile未安装最新的pypi版本

Python Dockerfile未安装最新的pypi版本,python,docker,pip,dockerfile,Python,Docker,Pip,Dockerfile,我有下面的Dockerfile来创建一个带有Flower的容器 FROM python:alpine # Get latest root certificates RUN apk add --no-cache ca-certificates && update-ca-certificates # Install the required packages RUN pip install --no-cache-dir redis flower RUN pip install f

我有下面的Dockerfile来创建一个带有Flower的容器

FROM python:alpine

# Get latest root certificates
RUN apk add --no-cache ca-certificates && update-ca-certificates

# Install the required packages
RUN pip install --no-cache-dir redis flower
RUN pip install future

# PYTHONUNBUFFERED: Force stdin, stdout and stderr to be totally unbuffered. (equivalent to `python -u`)
# PYTHONHASHSEED: Enable hash randomization (equivalent to `python -R`)
# PYTHONDONTWRITEBYTECODE: Do not write byte files to disk, since we maintain it as readonly. (equivalent to `python -B`)
ENV PYTHONUNBUFFERED=1 PYTHONHASHSEED=random PYTHONDONTWRITEBYTECODE=1

# Default port
EXPOSE 5555

# Run as a non-root user by default, run as user with least privileges.
USER nobody

ENTRYPOINT ["flower"]
Flower的当前pypi版本是0.9.5

但是,当我构建容器时,安装的版本是0.9.4,因此我必须使用
pip install flower--upgrade
手动升级包才能获得0.9.5版本


我不明白为什么没有安装最新版本,你能给我解释一下吗?

你能回答这个问题来显示
pip安装步骤的输出吗?包括Python版本和
pip
version,无需复制;我复制/粘贴了你的
Dockerfile
,并下载了
flower-0.9.5-py2.py3-none-any.whl(459kb)
它是使用Docker构建缓存的,而你以前是用旧版本构建的吗?回复:@DavidMaze的评论,如果你用
无缓存构建会发生什么情况(
Docker构建--无缓存…
)?(如果您正在使用类似的工具,则Dockerfile中的
复制Pipfile Pipfile.lock.
将重复安装,但仅当其中一个文件发生更改时。)