From fea727daf4425f334750249f599219f71204b5aa Mon Sep 17 00:00:00 2001 From: Jp Date: Thu, 26 Feb 2026 11:36:50 +0800 Subject: [PATCH] ci(Docker): add --cleanup flag to install-php-extensions Add the --cleanup flag to the install-php-extensions command to remove downloaded archives after installation, reducing the final image size. Use the --no-cache flag for the remote podman build in the deployment script to ensure a clean build from the latest source on the server. --- Dockerfile | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c06a2fa..7e93276 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update && apt-get install -y \ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions && \ - install-php-extensions pdo_mysql mbstring exif pcntl bcmath gd zip intl + install-php-extensions --cleanup pdo_mysql mbstring exif pcntl bcmath gd zip intl # Clear cache RUN apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/Makefile b/Makefile index 0717208..8910d3f 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ deploy: build deploy-server: @echo "Deploying to remote server $(SERVER_IP)..." @# Build image on the remote server - ssh $(SERVER_USER)@$(SERVER_IP) "cd $(SERVER_PATH) && sudo podman build -t $(IMG) ." + ssh $(SERVER_USER)@$(SERVER_IP) "cd $(SERVER_PATH) && sudo podman build --no-cache -t $(IMG) ." @# Generate temporary merged YAML for server in /tmp @sudo kubectl create configmap mkm-admin-config --from-env-file=.env --dry-run=client -o yaml > /tmp/server_deploy.yaml @echo "---" >> /tmp/server_deploy.yaml