Skip to content

Commit e78df8b

Browse files
author
Test User
committed
Fix docker on other branches
1 parent a8223f5 commit e78df8b

File tree

1 file changed

+55
-8
lines changed

1 file changed

+55
-8
lines changed

.github/workflows/build-wolfprovider.yml

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,42 @@ on:
1818
default: false
1919

2020
jobs:
21+
# Setup Docker environment - test if custom image is available
22+
setup_docker:
23+
name: Setup Docker Environment
24+
runs-on: ubuntu-22.04
25+
continue-on-error: true # Don't fail the workflow if this job fails
26+
permissions:
27+
contents: read
28+
packages: read
29+
outputs:
30+
success: ${{ steps.test_image.outputs.success }}
31+
# Try to use custom image from ghcr.io
32+
container:
33+
image: ghcr.io/wolfssl/build-wolfprovider-debian:bookworm
34+
env:
35+
DEBIAN_FRONTEND: noninteractive
36+
options: --cap-add=NET_ADMIN --cap-add=NET_RAW
37+
steps:
38+
- name: Test custom image availability
39+
id: test_image
40+
run: |
41+
echo "Custom Docker image is available and working"
42+
echo "success=true" >> $GITHUB_OUTPUT
43+
2144
build_wolfprovider_common:
2245
name: Build wolfProvider
2346
runs-on: ubuntu-22.04
24-
# Grant permissions to read packages from ghcr.io
47+
needs: setup_docker
48+
if: always()
2549
permissions:
2650
contents: read
2751
packages: read
28-
# Run inside Debian Bookworm using container from ghcr.io/wolfssl/build-wolfprovider-debian:bookworm
29-
# We are using this container to avoid having to install all the dependencies on the host machine
30-
# and speed up the build process.
31-
# Note: Docker image paths must be lowercase even though the GitHub org is wolfSSL
52+
# Use custom image if available, otherwise fallback to stock debian:bookworm
3253
container:
33-
image: ghcr.io/wolfssl/build-wolfprovider-debian:bookworm
54+
image: ${{ needs.setup_docker.outputs.success == 'true' && 'ghcr.io/wolfssl/build-wolfprovider-debian:bookworm' || 'debian:bookworm' }}
3455
env:
3556
DEBIAN_FRONTEND: noninteractive
36-
# Add network capabilities so ifconfig/RTNETLINK operations are permitted
37-
# These are passed to `docker run` as runtime options
3857
options: --cap-add=NET_ADMIN --cap-add=NET_RAW
3958
timeout-minutes: 20
4059
env:
@@ -43,6 +62,34 @@ jobs:
4362
WOLFPROV_PACKAGES_PATH: /tmp/wolfprov-packages
4463
DEBS_PATH: debs
4564
steps:
65+
# Install dependencies if using fallback stock debian:bookworm image
66+
- name: Install build dependencies (fallback)
67+
if: needs.setup_docker.outputs.success != 'true'
68+
run: |
69+
echo "Custom Docker image unavailable, installing dependencies on stock debian:bookworm..."
70+
apt-get update && apt-get install -y --no-install-recommends \
71+
build-essential \
72+
devscripts \
73+
debhelper \
74+
dh-autoreconf \
75+
libtool \
76+
pkg-config \
77+
git \
78+
wget \
79+
curl \
80+
ca-certificates \
81+
openssl \
82+
dpkg-dev \
83+
lintian \
84+
fakeroot \
85+
dh-exec \
86+
equivs \
87+
expect \
88+
xxd \
89+
bc \
90+
libdistro-info-perl
91+
echo "✓ Dependencies installed successfully"
92+
4693
# Check if artifact already exists from another job in the same workflow run
4794
# When multiple matrix jobs run in parallel, the first one to finish uploads the artifact
4895
# Other jobs can then find it and skip rebuilding (no need to download it, just check it exists)

0 commit comments

Comments
 (0)