Skip to content

Commit 4d7ce80

Browse files
netzkollektivaragon999
authored andcommitted
feat: Add bullseye docker image flavour
closes #24
1 parent 9d29ebd commit 4d7ce80

5 files changed

Lines changed: 249 additions & 10 deletions

File tree

.github/workflows/build-docker-images.yaml

Lines changed: 176 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
php-version: ['7.4', '8.0', '8.1']
21+
flavour: ['alpine', 'bullseye']
2122

2223
steps:
2324
- name: Clone
@@ -31,12 +32,13 @@ jobs:
3132
with:
3233
build-args: |
3334
PHP_VERSION=${{ matrix.php-version }}
34-
tags: "${{ env.DOCKER_REPOSITORY }}-base:${{ matrix.php-version }}"
35-
file: "Dockerfile.base"
35+
FLAVOUR=${{ matrix.flavour }}
36+
tags: "${{ env.DOCKER_REPOSITORY }}-base:${{ matrix.php-version }}-${{ matrix.flavour }}"
37+
file: "${{ matrix.flavour }}/Dockerfile.base"
3638
push: false
3739
load: true
38-
cache-from: type=gha,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.php-version }}
39-
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.php-version }}
40+
cache-from: type=gha,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.php-version }}-${{ matrix.flavour }}
41+
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.php-version }}-${{ matrix.flavour }}
4042
labels: |
4143
org.opencontainers.image.title=${{ github.event.repository.name }}
4244
org.opencontainers.image.description=${{ github.event.repository.description }}
@@ -78,7 +80,7 @@ jobs:
7880
- name: Push docker image
7981
if: ${{ steps.check-push.outputs.push }}
8082
run: |
81-
docker push "${{ env.DOCKER_REPOSITORY }}-base:${{ matrix.php-version }}"
83+
docker push "${{ env.DOCKER_REPOSITORY }}-base:${{ matrix.php-version }}-${{ matrix.flavour }}"
8284
8385
8486
build:
@@ -91,96 +93,251 @@ jobs:
9193
include:
9294
- shopware-version: v6.3.0.2
9395
php-version: "7.4"
96+
flavour: alpine
9497
template: https://github.com/shopware/production
9598
- shopware-version: v6.3.1.1
9699
php-version: "7.4"
100+
flavour: alpine
97101
template: https://github.com/shopware/production
98102
- shopware-version: v6.3.2.1
99103
php-version: "7.4"
104+
flavour: alpine
100105
template: https://github.com/shopware/production
101106
- shopware-version: v6.3.3.1
102107
php-version: "7.4"
108+
flavour: alpine
103109
template: https://github.com/shopware/production
104110
- shopware-version: v6.3.4.1
105111
php-version: "7.4"
112+
flavour: alpine
106113
template: https://github.com/shopware/production
107114
- shopware-version: v6.3.5.4
108115
php-version: "7.4"
116+
flavour: alpine
109117
template: https://github.com/shopware/production
110118
- shopware-version: v6.4.0.0
111119
php-version: "7.4"
120+
flavour: alpine
112121
template: https://github.com/shopware/production
113122
- shopware-version: v6.4.1.2
114123
php-version: "8.0"
124+
flavour: alpine
115125
template: https://github.com/shopware/production
116126
- shopware-version: v6.4.2.1
117127
php-version: "8.0"
128+
flavour: alpine
118129
template: https://github.com/shopware/production
119130
- shopware-version: v6.4.3.1
120131
php-version: "8.0"
132+
flavour: alpine
121133
template: https://github.com/shopware/production
122134
- shopware-version: v6.4.4.1
123135
php-version: "8.0"
136+
flavour: alpine
124137
template: https://github.com/shopware/production
125138
- shopware-version: v6.4.5.1
126139
php-version: "8.0"
140+
flavour: alpine
127141
template: https://github.com/shopware/production
128142
- shopware-version: v6.4.6.1
129143
php-version: "8.0"
144+
flavour: alpine
130145
template: https://github.com/shopware/production
131146
- shopware-version: v6.4.7.0
132147
php-version: "8.0"
148+
flavour: alpine
133149
template: https://github.com/shopware/production
134150
- shopware-version: v6.4.8.2
135151
php-version: "8.0"
152+
flavour: alpine
136153
template: https://github.com/shopware/production
137154
- shopware-version: v6.4.9.0
138155
php-version: "8.0"
156+
flavour: alpine
139157
template: https://github.com/shopware/production
140158
- shopware-version: v6.4.10.0
141159
php-version: "8.0"
160+
flavour: alpine
142161
template: https://github.com/shopware/production
143162
- shopware-version: v6.4.11.1
144163
php-version: "8.0"
164+
flavour: alpine
145165
template: https://github.com/shopware/production
146166
- shopware-version: v6.4.12.0
147167
php-version: "8.0"
168+
flavour: alpine
148169
template: https://github.com/shopware/production
149170
- shopware-version: v6.4.13.0
150171
php-version: "8.0"
172+
flavour: alpine
151173
template: https://github.com/shopware/production
152174
- shopware-version: v6.4.14.0
153175
php-version: "8.0"
176+
flavour: alpine
154177
template: https://github.com/shopware/production
155178
- shopware-version: v6.4.15.1
156179
php-version: "8.0"
180+
flavour: alpine
157181
template: https://github.com/shopware/production
158182
- shopware-version: v6.4.16.1
159183
php-version: "8.0"
184+
flavour: alpine
160185
template: https://github.com/shopware/production
161186
- shopware-version: v6.4.17.1
162187
php-version: "8.1"
188+
flavour: alpine
163189
template: https://github.com/shopware/production
164190
- shopware-version: v6.4.18.1
165191
php-version: "8.1"
192+
flavour: alpine
166193
template: https://github.com/shopware/production
167194
- shopware-version: v6.4.19.0
168195
php-version: "8.1"
196+
flavour: alpine
169197
template: https://github.com/shopware/production
170198
- shopware-version: v6.4.20.0
171199
php-version: "8.1"
200+
flavour: alpine
172201
template: https://github.com/shopware/production
173202
- shopware-version: v6.5.0.0-rc4
174203
php-version: "8.1"
204+
flavour: alpine
175205
template: https://github.com/shopware/platform
176206
- shopware-version: 6.3
177207
php-version: "7.4"
208+
flavour: alpine
178209
template: https://github.com/shopware/production
179210
- shopware-version: 6.4
180211
php-version: "8.1"
212+
flavour: alpine
181213
template: https://github.com/shopware/platform
182214
- shopware-version: trunk
183215
php-version: "8.1"
216+
flavour: alpine
217+
template: https://github.com/shopware/platform
218+
- shopware-version: v6.3.0.2
219+
php-version: "7.4"
220+
flavour: bullseye
221+
template: https://github.com/shopware/production
222+
- shopware-version: v6.3.1.1
223+
php-version: "7.4"
224+
flavour: bullseye
225+
template: https://github.com/shopware/production
226+
- shopware-version: v6.3.2.1
227+
php-version: "7.4"
228+
flavour: bullseye
229+
template: https://github.com/shopware/production
230+
- shopware-version: v6.3.3.1
231+
php-version: "7.4"
232+
flavour: bullseye
233+
template: https://github.com/shopware/production
234+
- shopware-version: v6.3.4.1
235+
php-version: "7.4"
236+
flavour: bullseye
237+
template: https://github.com/shopware/production
238+
- shopware-version: v6.3.5.4
239+
php-version: "7.4"
240+
flavour: bullseye
241+
template: https://github.com/shopware/production
242+
- shopware-version: v6.4.0.0
243+
php-version: "7.4"
244+
flavour: bullseye
245+
template: https://github.com/shopware/production
246+
- shopware-version: v6.4.1.2
247+
php-version: "8.0"
248+
flavour: bullseye
249+
template: https://github.com/shopware/production
250+
- shopware-version: v6.4.2.1
251+
php-version: "8.0"
252+
flavour: bullseye
253+
template: https://github.com/shopware/production
254+
- shopware-version: v6.4.3.1
255+
php-version: "8.0"
256+
flavour: bullseye
257+
template: https://github.com/shopware/production
258+
- shopware-version: v6.4.4.1
259+
php-version: "8.0"
260+
flavour: bullseye
261+
template: https://github.com/shopware/production
262+
- shopware-version: v6.4.5.1
263+
php-version: "8.0"
264+
flavour: bullseye
265+
template: https://github.com/shopware/production
266+
- shopware-version: v6.4.6.1
267+
php-version: "8.0"
268+
flavour: bullseye
269+
template: https://github.com/shopware/production
270+
- shopware-version: v6.4.7.0
271+
php-version: "8.0"
272+
flavour: bullseye
273+
template: https://github.com/shopware/production
274+
- shopware-version: v6.4.8.2
275+
php-version: "8.0"
276+
flavour: bullseye
277+
template: https://github.com/shopware/production
278+
- shopware-version: v6.4.9.0
279+
php-version: "8.0"
280+
flavour: bullseye
281+
template: https://github.com/shopware/production
282+
- shopware-version: v6.4.10.0
283+
php-version: "8.0"
284+
flavour: bullseye
285+
template: https://github.com/shopware/production
286+
- shopware-version: v6.4.11.1
287+
php-version: "8.0"
288+
flavour: bullseye
289+
template: https://github.com/shopware/production
290+
- shopware-version: v6.4.12.0
291+
php-version: "8.0"
292+
flavour: bullseye
293+
template: https://github.com/shopware/production
294+
- shopware-version: v6.4.13.0
295+
php-version: "8.0"
296+
flavour: bullseye
297+
template: https://github.com/shopware/production
298+
- shopware-version: v6.4.14.0
299+
php-version: "8.0"
300+
flavour: bullseye
301+
template: https://github.com/shopware/production
302+
- shopware-version: v6.4.15.1
303+
php-version: "8.0"
304+
flavour: bullseye
305+
template: https://github.com/shopware/production
306+
- shopware-version: v6.4.16.1
307+
php-version: "8.0"
308+
flavour: bullseye
309+
template: https://github.com/shopware/production
310+
- shopware-version: v6.4.17.1
311+
php-version: "8.1"
312+
flavour: bullseye
313+
template: https://github.com/shopware/production
314+
- shopware-version: v6.4.18.1
315+
php-version: "8.1"
316+
flavour: bullseye
317+
template: https://github.com/shopware/production
318+
- shopware-version: v6.4.19.0
319+
php-version: "8.1"
320+
flavour: bullseye
321+
template: https://github.com/shopware/production
322+
- shopware-version: v6.4.20.0
323+
php-version: "8.1"
324+
flavour: bullseye
325+
template: https://github.com/shopware/production
326+
- shopware-version: v6.5.0.0-rc4
327+
php-version: "8.1"
328+
flavour: bullseye
329+
template: https://github.com/shopware/platform
330+
- shopware-version: 6.3
331+
php-version: "7.4"
332+
flavour: bullseye
333+
template: https://github.com/shopware/production
334+
- shopware-version: 6.4
335+
php-version: "8.1"
336+
flavour: bullseye
337+
template: https://github.com/shopware/platform
338+
- shopware-version: trunk
339+
php-version: "8.1"
340+
flavour: bullseye
184341
template: https://github.com/shopware/platform
185342

186343
steps:
@@ -198,7 +355,12 @@ jobs:
198355
199356
[ "${shopware_version_tag}" == "" ] && exit 1
200357
201-
tag="${{ env.DOCKER_REPOSITORY }}:${shopware_version_tag}"
358+
tag="${{ env.DOCKER_REPOSITORY }}:${shopware_version_tag}-${{ matrix.flavour }}"
359+
360+
if [[ "${{ matrix.flavour }}" == "alpine" ]]; then
361+
tag="$tag, ${{ env.DOCKER_REPOSITORY }}:${shopware_version_tag}"
362+
fi
363+
202364
echo "Shopware version ${{ matrix.shopware-version }}"
203365
echo "Image Tag: ${tag}"
204366
@@ -214,11 +376,13 @@ jobs:
214376
SHOPWARE_VERSION=${{ matrix.shopware-version }}
215377
PHP_VERSION=${{ matrix.php-version }}
216378
TEMPLATE_REPOSITORY=${{ matrix.template }}
379+
FLAVOUR=${{ matrix.flavour }}
217380
tags: ${{ steps.get-docker-tag.outputs.tag }}
381+
file: "${{ matrix.flavour }}/Dockerfile"
218382
push: false
219383
load: true
220-
cache-from: type=gha,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.shopware-version }}
221-
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.shopware-version }}
384+
cache-from: type=gha,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.shopware-version }}-${{ matrix.flavour }}
385+
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ env.CACHE_KEY }}-${{ matrix.shopware-version }}-${{ matrix.flavour }}
222386
labels: |
223387
org.opencontainers.image.title=${{ github.event.repository.name }}
224388
org.opencontainers.image.description=${{ github.event.repository.description }}
@@ -260,4 +424,7 @@ jobs:
260424
- name: Push docker image
261425
if: ${{ steps.check-push.outputs.push }}
262426
run: |
263-
docker push ${{ steps.get-docker-tag.outputs.tag }}
427+
tags="${{ steps.get-docker-tag.outputs.tag }}"
428+
for tag in ${tags//,/}; do
429+
echo "docker push ${tag}"
430+
done

Dockerfile renamed to alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG PHP_VERSION=8.1
2-
FROM ghcr.io/friendsofshopware/platform-plugin-dev-base:${PHP_VERSION}
2+
FROM ghcr.io/friendsofshopware/platform-plugin-dev-base:${PHP_VERSION}-alpine
33

44
ARG SHOPWARE_VERSION=dev-trunk
55
ARG TEMPLATE_REPOSITORY=https://github.com/shopware/platform
File renamed without changes.

bullseye/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
ARG PHP_VERSION=8.1
2+
FROM ghcr.io/friendsofshopware/platform-plugin-dev-base:${PHP_VERSION}-bullseye
3+
4+
ARG SHOPWARE_VERSION=dev-trunk
5+
ARG TEMPLATE_REPOSITORY=https://github.com/shopware/production
6+
7+
ENV SHOPWARE_BUILD_DIR /opt/shopware
8+
9+
RUN \
10+
if echo "${SHOPWARE_VERSION}" | grep -q '^v6.4.*'; then \
11+
curl -fsSL https://deb.nodesource.com/setup_16.x | bash; \
12+
else \
13+
curl -fsSL https://deb.nodesource.com/setup_current.x | bash; \
14+
fi; \
15+
apt-get install nodejs
16+
17+
RUN \
18+
start-mysql && \
19+
mysql -e "CREATE DATABASE shopware" && \
20+
mysqladmin --user=root password 'root' && \
21+
mkdir -p /opt/shopware && \
22+
git clone -b ${SHOPWARE_VERSION} --depth 1 "${TEMPLATE_REPOSITORY}" "${SHOPWARE_BUILD_DIR}" && \
23+
cd "${SHOPWARE_BUILD_DIR}" && \
24+
mkdir -p custom && \
25+
composer install --no-interaction -o && \
26+
APP_URL="http://localhost" php bin/console system:setup --database-url=mysql://root:root@localhost:3306/shopware --generate-jwt-keys -nq && \
27+
php bin/console system:install -fnq --create-database && \
28+
composer clearcache && \
29+
rm -rf "${SHOPWARE_BUILD_DIR}/custom/plugins" && \
30+
mkdir -p /plugins && ln -s /plugins "${SHOPWARE_BUILD_DIR}/custom/plugins" && \
31+
rm -rf "${SHOPWARE_BUILD_DIR}/custom/apps" && \
32+
mkdir -p /apps && ln -s /apps "${SHOPWARE_BUILD_DIR}/custom/apps"
33+
34+
VOLUME /plugins
35+
WORKDIR /opt/shopware

0 commit comments

Comments
 (0)