我有一个laravel/php docker镜像,我更新到了php 8.1-我现在正试图回到我们的项目7.3版本,但无法工作。
这是我的YAML
###############################################################################
# Generated on forwardforce.io #
###############################################################################
version: "3.1"
services:
postgres:
image: postgres:11.1-alpine
container_name: mtn-postgres
working_dir: /application
volumes:
- db:/var/lib/postgresql/data
- .:/application
ports:
- 5001:5432
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=forge
webserver:
image: nginx:alpine
container_name: mtn-webserver
working_dir: /application
volumes:
- .:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8091:80"
tty: true
php-fpm:
build: phpdocker/php-fpm
container_name: mtn-php-fpm
working_dir: /application
environment:
XDEBUG_CONFIG: "remote_host=docker.for.mac.host.internal"
PHP_IDE_CONFIG: "serverName=MTN-Docker"
image: php:7.2-alpine
volumes:
- .:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
volumes:
db:
这是我的Dockerfile
FROM php:7.4-fpm-alpine
WORKDIR "/application"
# Fix debconf warnings upon build
ARG DEBIAN_FRONTEND=noninteractive
# Install git
RUN apt-get update
&& apt-get -y install libpng-dev
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install selected extensions and other stuff
RUN apt-get update
&& apt-get -y --no-install-recommends install php7.2-pgsql php7.2-gd php-xdebug php-ssh2
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install git
RUN apt-get update
&& apt-get -y install git
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install php-imagick
RUN apt-get update
&& apt-get -y install php-imagick
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
# Install Node.js, Yarn and required dependencies
RUN apt-get update
&& apt-get install -y curl gnupg build-essential
&& curl --silent --location https://deb.nodesource.com/setup_10.x | bash -
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
&& apt-get remove -y --purge cmdtest
&& apt-get update
&& apt-get install -y nodejs yarn
# remove useless files from the current layer
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists.d/*
&& apt-get autoremove
&& apt-get clean
&& apt-get autoclean
RUN npm install -g cordova ionic
RUN npm i -D -E -g @angular/cli
我已经删除了docker缓存&容器并运行:docker-compose up -d --force-recreate --build
但我确实看到了";59bf1c3509f3已经存在";在运行时在构建中。完成后,我有了最新版本的PHP 8.13
那么它可能是另一个我没有清理的缓存吗?或者如何强制安装PHP 7.2 o 7.3
apt
是基于Debian的分发的包管理器。使用apk
管理Alpine Linux上的软件包。请参阅如何使用此图像。