Skip to content

Commit 388a161

Browse files
committed
Don't build separate container images for debos/fakemachine
Building separate container images for each project was a bit of a premature optimisation which just made things more complicated. Instead of building separate containers for debos/fakemachine, build one generic container which may be used for either project. Signed-off-by: Christopher Obbard <[email protected]>
1 parent becf4bc commit 388a161

File tree

5 files changed

+26
-67
lines changed

5 files changed

+26
-67
lines changed

.github/workflows/container.yaml

+8-36
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
jobs:
1717
build-containers:
1818
runs-on: ubuntu-latest
19-
name: Build ${{ matrix.variant }} containers
19+
name: Build ${{ matrix.variant }} container
2020
permissions:
2121
contents: read
2222
packages: write
@@ -51,57 +51,29 @@ jobs:
5151
username: ${{ github.actor }}
5252
password: ${{ secrets.GITHUB_TOKEN }}
5353

54-
# Build Fakemachine containers
55-
- name: Extract metadata (tags, labels) for Fakemachine Docker image
56-
id: meta-fakemachine
54+
- name: Extract metadata (tags, labels) for Docker image
55+
id: meta
5756
uses: docker/metadata-action@v5
5857
with:
59-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/fakemachine-${{ matrix.variant }}
58+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.variant }}
6059
tags: |
6160
"type=ref,event=branch"
6261
"type=ref,suffix=-{{sha}},event=branch"
6362
"type=ref,suffix=-{{date 'YYYYMMDD'}},event=branch"
6463
"type=ref,event=tag"
6564
"type=ref,event=pr"
6665
67-
- name: Build and push Fakemachine Docker image
66+
- name: Build and push Docker image
6867
uses: docker/build-push-action@v5
6968
with:
7069
context: .
71-
file: Dockerfile.fakemachine-${{ matrix.dockerfile }}
70+
file: Dockerfile.${{ matrix.dockerfile }}
7271
push: ${{ github.event_name != 'pull_request' }}
73-
tags: ${{ steps.meta-fakemachine.outputs.tags }}
74-
labels: ${{ steps.meta-fakemachine.outputs.labels }}
72+
tags: ${{ steps.meta.outputs.tags }}
73+
labels: ${{ steps.meta.outputs.labels }}
7574
build-args: |
7675
VARIANT=${{ matrix.variant }}
7776
78-
# Build Debos containers (based on Fakemachine container)
79-
- name: Extract metadata (tags, labels) for Debos Docker image
80-
id: meta-debos
81-
uses: docker/metadata-action@v5
82-
with:
83-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/debos-${{ matrix.variant }}
84-
tags: |
85-
"type=ref,event=branch"
86-
"type=ref,suffix=-{{sha}},event=branch"
87-
"type=ref,suffix=-{{date 'YYYYMMDD'}},event=branch"
88-
"type=ref,event=tag"
89-
"type=ref,event=pr"
90-
91-
- name: Build and push Debos Docker image
92-
uses: docker/build-push-action@v5
93-
with:
94-
context: .
95-
file: Dockerfile.debos-${{ matrix.dockerfile }}
96-
push: ${{ github.event_name != 'pull_request' }}
97-
tags: ${{ steps.meta-debos.outputs.tags }}
98-
labels: ${{ steps.meta-debos.outputs.labels }}
99-
build-args: |
100-
VARIANT=${{ matrix.variant }}
101-
BASE_REGISTRY=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
102-
BASE_IMAGE=fakemachine-${{ matrix.variant }}
103-
BASE_TAG=${{ steps.meta-fakemachine.outputs.version }}
104-
10577
# Job to key success status against
10678
allgreen:
10779
name: allgreen

Dockerfile.fakemachine-arch Dockerfile.arch

+8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@ RUN pacman -Syu --noconfirm qemu-base \
1010
--assume-installed initramfs \
1111
&& find /var/cache/pacman/pkg -mindepth 1 -delete
1212

13+
# Bits needed to run debos
14+
RUN pacman -Syu --noconfirm dpkg \
15+
unzip \
16+
&& find /var/cache/pacman/pkg -mindepth 1 -delete
1317

1418
# Bits needed to build fakemachine
1519
RUN pacman -Syu --noconfirm go \
1620
git \
1721
&& find /var/cache/pacman/pkg -mindepth 1 -delete
22+
23+
# Bits needed to build debos
24+
RUN pacman -Syu --noconfirm ostree \
25+
&& find /var/cache/pacman/pkg -mindepth 1 -delete

Dockerfile.fakemachine-debian Dockerfile.debian

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ RUN if [ "$VARIANT" != "bullseye" ] ; then \
2323
apt-get install --no-install-recommends -y systemd-resolved; \
2424
fi
2525

26+
# Bits needed to run debos
27+
RUN apt-get update && \
28+
apt-get install --no-install-recommends -y \
29+
unzip
30+
2631
# Bits needed to build fakemachine
2732
RUN apt-get update && \
2833
apt-get install --no-install-recommends -y \
@@ -31,3 +36,8 @@ RUN apt-get update && \
3136
ca-certificates \
3237
gcc \
3338
libc6-dev
39+
40+
# Bits needed to build debos
41+
RUN apt-get update && \
42+
apt-get install --no-install-recommends -y \
43+
libostree-dev

Dockerfile.debos-arch

-13
This file was deleted.

Dockerfile.debos-debian

-18
This file was deleted.

0 commit comments

Comments
 (0)