-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
187 lines (166 loc) · 6.32 KB
/
Makefile
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
.PHONY: build snyk
LOCAL_PHP_VERSION ?= 8.2
build: all-cli all-cli-dev all-php-fpm all-php-fpm-dev all-nginx all-nginx-dev
snyk: snyk-all-cli snyk-all-cli-dev snyk-all-php-fpm snyk-all-php-fpm-dev snyk-all-nginx snyk-all-nginx-dev
all-cli:
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.2 \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:8.2 8.2
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.1 \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:8.1 8.1
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.0 \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:8.0 8.0
all-cli-dev:
docker buildx build --load --platform linux/amd64 --builder all-platforms \
-f 8.2/dev.Dockerfile \
--build-arg PHP_VERSION=8.2 \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:8.2-dev 8.2
docker buildx build --load --platform linux/amd64 --builder all-platforms \
-f 8.1/dev.Dockerfile \
--build-arg PHP_VERSION=8.1 \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:8.1-dev 8.1
docker buildx build --load --platform linux/amd64 --builder all-platforms \
-f 8.0/dev.Dockerfile \
--build-arg PHP_VERSION=8.0 \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:8.0-dev 8.0
all-php-fpm:
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.2 \
--build-arg PROJECT_TYPE=fpm \
-t craftcms/php-fpm:8.2 8.2
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.1 \
--build-arg PROJECT_TYPE=fpm \
-t craftcms/php-fpm:8.1 8.1
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.0 \
--build-arg PROJECT_TYPE=fpm \
-t craftcms/php-fpm:8.0 8.0
all-php-fpm-dev:
docker buildx build --load --platform linux/amd64 --builder all-platforms \
-f 8.2/dev.Dockerfile \
--build-arg PHP_VERSION=8.2 \
--build-arg PROJECT_TYPE=php-fpm \
-t craftcms/php-fpm:8.2-dev 8.2
docker buildx build --load --platform linux/amd64 --builder all-platforms \
-f 8.1/dev.Dockerfile \
--build-arg PHP_VERSION=8.1 \
--build-arg PROJECT_TYPE=php-fpm \
-t craftcms/php-fpm:8.1-dev 8.1
docker buildx build --load --platform linux/amd64 --builder all-platforms \
-f 8.0/dev.Dockerfile \
--build-arg PHP_VERSION=8.0 \
--build-arg PROJECT_TYPE=php-fpm \
-t craftcms/php-fpm:8.0-dev 8.0
all-nginx:
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.2 \
-t craftcms/nginx:8.2 nginx
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.1 \
-t craftcms/nginx:8.1 nginx
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.0 \
-t craftcms/nginx:8.0 nginx
all-nginx-dev:
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.2 \
--build-arg NGINX_CONF=dev.default.conf \
-t craftcms/nginx:8.2-dev nginx
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.1 \
--build-arg NGINX_CONF=dev.default.conf \
-t craftcms/nginx:8.1-dev nginx
docker buildx build --load --platform linux/amd64 --builder all-platforms \
--build-arg PHP_VERSION=8.0 \
--build-arg NGINX_CONF=dev.default.conf \
-t craftcms/nginx:8.0-dev nginx
setup:
docker buildx create --name all-platforms --platform linux/amd64,linux/arm64
docker buildx use all-platforms
docker buildx inspect --bootstrap
local:
docker buildx build --load --platform linux/amd64 \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
--build-arg PROJECT_TYPE=fpm \
-t craftcms/php-fpm:${LOCAL_PHP_VERSION} ${LOCAL_PHP_VERSION}
docker buildx build --load --platform linux/amd64 \
-f ${LOCAL_PHP_VERSION}/dev.Dockerfile \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
--build-arg PROJECT_TYPE=php-fpm \
-t craftcms/php-fpm:${LOCAL_PHP_VERSION}-dev ${LOCAL_PHP_VERSION}
docker buildx build --load --platform linux/amd64 \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:${LOCAL_PHP_VERSION} ${LOCAL_PHP_VERSION}
docker buildx build --load --platform linux/amd64 \
-f ${LOCAL_PHP_VERSION}/dev.Dockerfile \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
--build-arg PROJECT_TYPE=cli \
-t craftcms/cli:${LOCAL_PHP_VERSION}-dev ${LOCAL_PHP_VERSION}
docker buildx build --load --platform linux/amd64 \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
-t craftcms/nginx:${LOCAL_PHP_VERSION} nginx
docker buildx build --load --platform linux/amd64 \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
--build-arg NGINX_CONF=dev.default.conf \
-t craftcms/nginx:${LOCAL_PHP_VERSION}-dev nginx
run:
docker buildx build --load --platform linux/amd64 \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
--build-arg PROJECT_TYPE=fpm \
-t craftcms/php-fpm:${LOCAL_PHP_VERSION} ${LOCAL_PHP_VERSION}
docker run --rm -it craftcms/php-fpm:${LOCAL_PHP_VERSION} sh
run-dev:
docker buildx build --load --platform linux/amd64 \
-f ${LOCAL_PHP_VERSION}/dev.Dockerfile \
--build-arg PHP_VERSION=${LOCAL_PHP_VERSION} \
--build-arg PROJECT_TYPE=php-fpm \
-t craftcms/php-fpm:${LOCAL_PHP_VERSION}-dev ${LOCAL_PHP_VERSION}
docker run --rm -it craftcms/php-fpm:${LOCAL_PHP_VERSION}-dev sh
snyk-local:
snyk container test \
craftcms/php-fpm:${LOCAL_PHP_VERSION} \
craftcms/php-fpm:${LOCAL_PHP_VERSION}-dev \
craftcms/cli:${LOCAL_PHP_VERSION} \
craftcms/cli:${LOCAL_PHP_VERSION}-dev \
craftcms/nginx:${LOCAL_PHP_VERSION} \
craftcms/nginx:${LOCAL_PHP_VERSION}-dev
snyk-all-cli:
snyk container test \
craftcms/cli:8.2 \
craftcms/cli:8.1 \
craftcms/cli:8.0
snyk-all-cli-dev:
snyk container test \
craftcms/cli:8.2-dev \
craftcms/cli:8.1-dev \
craftcms/cli:8.0-dev
snyk-all-php-fpm:
snyk container test \
craftcms/php-fpm:8.2 \
craftcms/php-fpm:8.1 \
craftcms/php-fpm:8.0
snyk-all-php-fpm-dev:
snyk container test \
craftcms/php-fpm:8.2-dev \
craftcms/php-fpm:8.1-dev \
craftcms/php-fpm:8.0-dev
snyk-all-nginx:
snyk container test \
craftcms/nginx:8.2 \
craftcms/nginx:8.1 \
craftcms/nginx:8.0
snyk-all-nginx-dev:
snyk container test \
craftcms/nginx:8.2-dev \
craftcms/nginx:8.1-dev \
craftcms/nginx:8.0-dev