-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·59 lines (51 loc) · 1.43 KB
/
build.sh
File metadata and controls
executable file
·59 lines (51 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env sh
PLATFORMS=linux/amd64,linux/arm64,linux/arm/v7
IMAGE_NAME=mgdteam/php
PHP_VERSION="$1"
COMPOSER_VERSION=2.8.3
# Select a build preset with specific Alpine and Composer version
case $PHP_VERSION in
"8.0")
ALPINE_VERSION=3.16
;;
"8.1")
ALPINE_VERSION=3.20
;;
"8.2")
ALPINE_VERSION=3.20
;;
"8.3")
ALPINE_VERSION=3.22
COMPOSER_VERSION=2.9.3
;;
"8.4")
ALPINE_VERSION=3.23
COMPOSER_VERSION=2.9.3
;;
"8.5")
ALPINE_VERSION=3.23
COMPOSER_VERSION=2.9.3
;;
esac
echo "\n================================="
echo "PHP version: $PHP_VERSION"
echo "Build platforms: $PLATFORMS"
echo "Alpine version: $ALPINE_VERSION"
echo "Composer version: $COMPOSER_VERSION"
echo "=================================\n"
docker buildx build --no-cache \
--platform ${PLATFORMS} \
-f Dockerfile.fpm \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
--build-arg COMPOSER_VERSION=${COMPOSER_VERSION} \
-t ${IMAGE_NAME}:${PHP_VERSION}-alpine${ALPINE_VERSION}-fpm-nginx . \
--push
docker buildx build --no-cache \
--platform ${PLATFORMS} \
-f Dockerfile.cli \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
--build-arg COMPOSER_VERSION=${COMPOSER_VERSION} \
-t ${IMAGE_NAME}:${PHP_VERSION}-alpine${ALPINE_VERSION}-cli . \
--push