forked from brefphp/aws-lambda-layers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-bake.hcl
103 lines (96 loc) · 2.87 KB
/
docker-bake.hcl
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
group "default" {
targets = ["build-php", "php", "php-fpm", "console-zip", "console", "php-fpm-dev"]
}
variable "CPU" {
default = "x86"
}
variable "CPU_PREFIX" {
default = ""
}
variable "PHP_VERSION" {
default = "80"
}
variable "IMAGE_VERSION_SUFFIX" {
default = "x86_64"
}
variable "DOCKER_PLATFORM" {
default = "linux/amd64"
}
variable "PHP_COMPILATION_FLAGS" {
default = ""
}
target "build-php" {
dockerfile = "php-${PHP_VERSION}/Dockerfile"
target = "build-environment"
tags = ["bref/${CPU_PREFIX}build-php-${PHP_VERSION}"]
args = {
"IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}"
"PHP_COMPILATION_FLAGS" = "${PHP_COMPILATION_FLAGS}"
}
platforms = ["${DOCKER_PLATFORM}"]
}
target "php" {
dockerfile = "php-${PHP_VERSION}/Dockerfile"
target = "function"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}"]
args = {
"IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}"
"PHP_COMPILATION_FLAGS" = "${PHP_COMPILATION_FLAGS}"
}
contexts = {
"bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = "target:build-php"
}
platforms = ["${DOCKER_PLATFORM}"]
}
target "php-fpm" {
dockerfile = "php-${PHP_VERSION}/Dockerfile"
target = "fpm"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm"]
args = {
"IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}"
}
contexts = {
"bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = "target:build-php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}" = "target:php"
}
platforms = ["${DOCKER_PLATFORM}"]
}
target "console-zip" {
context = "layers/console"
target = "console-zip"
tags = ["bref/console-zip"]
args = {
PHP_VERSION = "${PHP_VERSION}"
CPU_PREFIX = "${CPU_PREFIX}"
}
platforms = ["${DOCKER_PLATFORM}"]
}
target "console" {
context = "layers/console"
target = "console"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}-console"]
args = {
PHP_VERSION = "${PHP_VERSION}"
CPU_PREFIX = "${CPU_PREFIX}"
}
contexts = {
"bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = "target:build-php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}" = "target:php"
}
platforms = ["${DOCKER_PLATFORM}"]
}
target "php-fpm-dev" {
context = "layers/fpm-dev"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm-dev"]
args = {
PHP_VERSION = "${PHP_VERSION}"
CPU_PREFIX = "${CPU_PREFIX}"
}
contexts = {
"bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = "target:build-php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}" = "target:php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm" = "target:php-fpm"
"bref/local-api-gateway" = "docker-image://bref/local-api-gateway:latest"
}
platforms = ["${DOCKER_PLATFORM}"]
}