Skip to content

Commit a80b45f

Browse files
authored
Refactor image building (e.g. using Buildah instead of Docker) (#66)
* Change: Use Podman / Buildah to build, test and push images * Change: Pin workflow dependencies * Change: Fix build by specifying containerfiles * Change: Fix build by dropping redundant image tag * Change: Disable upgrade by default * Remove: No longer needed update toggle * Add: Require Slackware current to be updated * Change: Fix baseimage for Slackware * Change: Include registry in baseimage names
1 parent 92fe5ec commit a80b45f

File tree

19 files changed

+39
-56
lines changed

19 files changed

+39
-56
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ jobs:
124124
TAG: "24.03-lts"
125125
- CONTEXT: operating_systems/oraclelinux
126126
TAG: "5"
127-
UPDATED: false
128127
- CONTEXT: operating_systems/oraclelinux
129128
TAG: "6"
130129
- CONTEXT: operating_systems/oraclelinux
@@ -136,59 +135,45 @@ jobs:
136135
- CONTEXT: operating_systems/rhel
137136
BASEIMAGE: registry.access.redhat.com/ubi7
138137
TAG: "7.6"
139-
UPDATED: false
140138
- CONTEXT: operating_systems/rhel
141139
BASEIMAGE: registry.access.redhat.com/ubi7
142140
TAG: "7.7"
143-
UPDATED: false
144141
- CONTEXT: operating_systems/rhel
145142
BASEIMAGE: registry.access.redhat.com/ubi7
146143
TAG: "7.8"
147-
UPDATED: false
148144
- CONTEXT: operating_systems/rhel
149145
BASEIMAGE: registry.access.redhat.com/ubi7
150146
TAG: "7.9"
151-
UPDATED: false
152147
- CONTEXT: operating_systems/rhel
153148
BASEIMAGE: registry.access.redhat.com/ubi8
154149
TAG: "8.0"
155-
UPDATED: false
156150
- CONTEXT: operating_systems/rhel
157151
BASEIMAGE: registry.access.redhat.com/ubi8
158152
TAG: "8.1"
159-
UPDATED: false
160153
- CONTEXT: operating_systems/rhel
161154
BASEIMAGE: registry.access.redhat.com/ubi8
162155
TAG: "8.2"
163-
UPDATED: false
164156
- CONTEXT: operating_systems/rhel
165157
BASEIMAGE: registry.access.redhat.com/ubi8
166158
TAG: "8.3"
167-
UPDATED: false
168159
- CONTEXT: operating_systems/rhel
169160
BASEIMAGE: registry.access.redhat.com/ubi8
170161
TAG: "8.4"
171-
UPDATED: false
172162
- CONTEXT: operating_systems/rhel
173163
BASEIMAGE: registry.access.redhat.com/ubi8
174164
TAG: "8.5"
175-
UPDATED: false
176165
- CONTEXT: operating_systems/rhel
177166
BASEIMAGE: registry.access.redhat.com/ubi8
178167
TAG: "8.6"
179-
UPDATED: false
180168
- CONTEXT: operating_systems/rhel
181169
BASEIMAGE: registry.access.redhat.com/ubi8
182170
TAG: "8.7"
183-
UPDATED: false
184171
- CONTEXT: operating_systems/rhel
185172
BASEIMAGE: registry.access.redhat.com/ubi9
186173
TAG: "9.0.0"
187-
UPDATED: false
188174
- CONTEXT: operating_systems/rhel
189175
BASEIMAGE: registry.access.redhat.com/ubi9
190176
TAG: "9.1.0"
191-
UPDATED: false
192177
- CONTEXT: operating_systems/rockylinux
193178
TAG: "8.5"
194179
- CONTEXT: operating_systems/rockylinux
@@ -217,6 +202,7 @@ jobs:
217202
TAG: "15.0"
218203
- CONTEXT: operating_systems/slackware
219204
TAG: current
205+
UPDATED: true
220206
- CONTEXT: operating_systems/ubuntu
221207
TAG: "10.04"
222208
- CONTEXT: operating_systems/ubuntu
@@ -273,9 +259,9 @@ jobs:
273259
TAG: "24.10"
274260
steps:
275261
- name: Checkout repository
276-
uses: actions/checkout@v4
262+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
277263
- name: Login to Docker Registry
278-
uses: docker/login-action@v3
264+
uses: redhat-actions/podman-login@4934294ad0449894bcd1e9f191899d7292469603 # v1.7
279265
with:
280266
registry: ghcr.io
281267
username: ${{ github.actor }}
@@ -295,29 +281,26 @@ jobs:
295281
echo "EOF" >> $GITHUB_ENV
296282
297283
- name: Build Docker image
298-
uses: docker/build-push-action@v6
284+
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2.13
299285
with:
300286
context: ${{ matrix.CONTEXT }}
301-
load: true
287+
containerfiles: ${{ matrix.CONTEXT }}/Dockerfile
302288
tags: ${{ env.IMAGE }}
303289
build-args: ${{ env.BUILD_ARGS }}
304290

305291
- name: Test Docker image
306292
run: |
307-
docker run --rm -d --name target -p 2222:22 ${{ env.IMAGE }}
293+
podman run --rm -d --name target -p 2222:22 ${{ env.IMAGE }}
308294
sshpass -p demo ssh \
309295
-o "StrictHostKeyChecking no" \
310296
-o "KexAlgorithms $(ssh -Q kex | tr '\n' ',' | head -c -1)" \
311297
-o "Ciphers $(ssh -Q ciphers | tr '\n' ',' | head -c -1)" \
312298
-o "HostKeyAlgorithms $(ssh -Q key | tr '\n' ',' | head -c -1)" \
313299
demo@localhost -p 2222 echo "Hello from \$(whoami)@\$(cat /etc/hostname)"
314-
docker stop target
300+
podman stop target
315301
316302
- name: Publish Docker image
317-
uses: docker/build-push-action@v6
303+
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
318304
if: ${{ github.event_name == 'push' }}
319305
with:
320-
context: ${{ matrix.CONTEXT }}
321-
push: true
322306
tags: ${{ env.IMAGE }}
323-
build-args: ${{ env.BUILD_ARGS }}

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: 'Dependency Review'
12-
uses: greenbone/actions/dependency-review@v3
12+
uses: greenbone/actions/dependency-review@a1883bd24d2d921426b3f06413e84606ecd43bdd # v3.27.11

.github/workflows/sbom-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
contents: write
1212
steps:
1313
- name: 'SBOM upload'
14-
uses: greenbone/actions/sbom-upload@v3
14+
uses: greenbone/actions/sbom-upload@a1883bd24d2d921426b3f06413e84606ecd43bdd # v3.27.11

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ To build e.g. the image for Mageia 8 use:
164164
docker build operating_systems/mageia --build-arg=TAG=8 -t mageia:8
165165
```
166166

167-
If not specified otherwise, the image will be built with its packages explicitly updated. This is available for most images. To build the image for Oracle Linux 5 (non-updated) use:
167+
If not specified otherwise, the image will be built with its packages explicitly not updated. This is available for most images. To build the image for Oracle Linux 5 (updated) use:
168168

169169
```
170-
docker build operating_systems/oraclelinux --build-arg=TAG=5 --build-arg=UPDATED=false -t oraclelinux:5
170+
docker build operating_systems/oraclelinux --build-arg=TAG=5 --build-arg=UPDATED=true -t oraclelinux:5
171171
```

applications/generic/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG BASEIMAGE
22
ARG TAG
33

44
FROM ghcr.io/greenbone/vt-test-environments/${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66
ARG TAG
77

88
# Install dependencies

applications/home-assistant/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASEIMAGE=homeassistant/home-assistant
1+
ARG BASEIMAGE=docker.io/homeassistant/home-assistant
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}

applications/oracle-weblogic/10.3.6.0-2017/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=vulhub/weblogic
1+
ARG BASEIMAGE=docker.io/vulhub/weblogic
22
ARG TAG=10.3.6.0-2017
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
ENV DEBIAN_FRONTEND=noninteractive
88
RUN ( \

applications/oracle-weblogic/12.2.1.3-2018/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=vulhub/weblogic
1+
ARG BASEIMAGE=docker.io/vulhub/weblogic
22
ARG TAG=12.2.1.3-2018
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
USER root
88

operating_systems/almalinux/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=almalinux
1+
ARG BASEIMAGE=docker.io/library/almalinux
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66
ARG TAG
77

88
# Lock releasever to the tag to pin the minor release

operating_systems/amazonlinux/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=amazonlinux
1+
ARG BASEIMAGE=docker.io/library/amazonlinux
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
RUN if [ "$UPDATED" = true ]; then yum upgrade -y; fi \
88
&& yum install -y openssh-server passwd \

operating_systems/debian/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=debian
1+
ARG BASEIMAGE=docker.io/library/debian
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
ENV DEBIAN_FRONTEND=noninteractive
88
RUN apt-get update \

operating_systems/euleros/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Don't use anything RHEL 9-based. It'll break the RPM GPG key.
2-
FROM rockylinux:8.6 as builder
2+
FROM docker.io/library/rockylinux:8.6 as builder
33

44
ARG TAG
55
WORKDIR /tmp

operating_systems/fedora/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=fedora
1+
ARG BASEIMAGE=docker.io/library/fedora
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
RUN if [ "$UPDATED" = true ]; then dnf upgrade -y; fi \
88
&& dnf install -y openssh-server \

operating_systems/mageia/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=mageia
1+
ARG BASEIMAGE=docker.io/library/mageia
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
RUN if [ "$UPDATED" = true ]; then dnf upgrade -y; fi \
88
&& dnf install -y openssh-server \

operating_systems/openeuler/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=openeuler/openeuler
1+
ARG BASEIMAGE=docker.io/openeuler/openeuler
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
RUN if [ "$UPDATED" = true ]; then dnf upgrade -y; fi \
88
&& dnf install -y openssh-server passwd \

operating_systems/oraclelinux/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=oraclelinux
1+
ARG BASEIMAGE=docker.io/library/oraclelinux
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
RUN if [ "$UPDATED" = true ]; then yum upgrade -y && yum clean all; fi \
88
&& useradd demo \

operating_systems/rockylinux/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=rockylinux
1+
ARG BASEIMAGE=docker.io/library/rockylinux
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66
ARG TAG
77

88
# Lock releasever to the tag to pin the minor release

operating_systems/slackware/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=vbatts/slackware
1+
ARG BASEIMAGE=docker.io/vbatts/slackware
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
RUN slackpkg update \
88
# When updating, we need to upgrade slackpkg itself first. Otherwise upgrade-all will abort.

operating_systems/ubuntu/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG BASEIMAGE=ubuntu
1+
ARG BASEIMAGE=docker.io/library/ubuntu
22
ARG TAG
33

44
FROM ${BASEIMAGE}:${TAG}
5-
ARG UPDATED=true
5+
ARG UPDATED=false
66

77
ENV DEBIAN_FRONTEND=noninteractive
88
RUN ( \

0 commit comments

Comments
 (0)