Docker 在构建镜像时会使用缓存机制。如果新的代码或配置没有触发缓存失效,可能会导致旧镜像被重复使用。
清除缓存后重新构建镜像:
docker build --no-cache -t {镜像名称} .