We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fc78d9 commit 084fa2dCopy full SHA for 084fa2d
1 file changed
build.sh
@@ -0,0 +1,23 @@
1
+#!/bin/bash
2
+
3
+# List of PHP versions to build
4
+PHP_VERSIONS=("7.0" "7.1" "7.2" "7.4" "8.0" "8.1" "8.2" "8.3" "8.4")
5
6
+# Base image name
7
+IMAGE_NAME="pattonwebz/local-wordpress-with-xdebug"
8
9
+# Build for all versions
10
+for version in "${PHP_VERSIONS[@]}"; do
11
+ echo "Building image for PHP $version..."
12
+ docker build --build-arg PHP_VERSION="php${version}-apache" -t "${IMAGE_NAME}:php${version}-apache" .
13
14
+ # Tag latest for the newest stable version (currently 8.2)
15
+ if [ "$version" = "8.2" ]; then
16
+ docker tag $IMAGE_NAME:"php${version}-apache" $IMAGE_NAME:latest
17
+ echo "Tagged PHP $version as latest"
18
+ fi
19
+done
20
21
+echo "All images built successfully"
22
+echo "Available images:"
23
+docker images | grep $IMAGE_NAME
0 commit comments