Skip to content

Commit 1e4ad4d

Browse files
committed
packaging: fix the need of multiple Dockerfiles for opensuse, clean some coderabbit concerns
Signed-off-by: Dan Illescas <daniel.illescas@hpe.com>
1 parent b8d8fb5 commit 1e4ad4d

File tree

10 files changed

+127
-209
lines changed

10 files changed

+127
-209
lines changed

install.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,33 @@ apt-get -y update
148148
$INSTALL_CMD_PREFIX apt-get -y $APT_PARAMETERS install $INSTALL_PACKAGE_NAME$APT_VERSION
149149
SCRIPT
150150
;;
151-
opensuse-leap|sles)
151+
opensuse-leap)
152+
# Leap has a VERSION_ID like "15.6"
152153
$SUDO sh <<SCRIPT
153154
rpm --import $RELEASE_KEY
154155
cat << EOF > /etc/zypp/repos.d/fluent-bit.repo
155156
[fluent-bit]
156157
name = Fluent Bit
157-
baseurl = $RELEASE_URL/suse/\$releasever
158+
baseurl = $RELEASE_URL/opensuse/leap/$VERSION_ID
159+
gpgcheck=1
160+
repo_gpgcheck=1
161+
gpgkey=$RELEASE_KEY
162+
enabled=1
163+
type=rpm-md
164+
autorefresh=1
165+
EOF
166+
cat /etc/zypp/repos.d/fluent-bit.repo
167+
zypper --non-interactive --gpg-auto-import-keys refresh
168+
$INSTALL_CMD_PREFIX zypper --non-interactive --gpg-auto-import-keys $ZYPPER_PARAMETERS install $INSTALL_PACKAGE_NAME$ZYPPER_VERSION
169+
SCRIPT
170+
;;
171+
sles)
172+
$SUDO sh <<SCRIPT
173+
rpm --import $RELEASE_KEY
174+
cat << EOF > /etc/zypp/repos.d/fluent-bit.repo
175+
[fluent-bit]
176+
name = Fluent Bit
177+
baseurl = $RELEASE_URL/sles/\$releasever
158178
gpgcheck=1
159179
repo_gpgcheck=1
160180
gpgkey=$RELEASE_KEY

packaging/README.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,56 +9,56 @@ This can take some time to complete so is only triggered via the label on-demand
99

1010
The [`distros`](./distros/) directory contains OCI container definitions used to build [Fluent Bit](http://fluentbit.io) Linux packages for different distros, the following table describe the supported targets:
1111

12-
| Distro | Version / Code Name | Arch | Target Option |
13-
|---------------|---------------------------|---------|--------------------------|
14-
| AlmaLinux | 10 | x86_64 | almalinux/10 |
15-
| AlmaLinux | 10 | arm64v8 | almalinux/10.arm64v8 |
16-
| AlmaLinux | 9 | x86_64 | almalinux/9 |
17-
| AlmaLinux | 9 | arm64v8 | almalinux/9.arm64v8 |
18-
| AlmaLinux | 8 | x86_64 | almalinux/8 |
19-
| AlmaLinux | 8 | arm64v8 | almalinux/8.arm64v8 |
20-
| AmazonLinux | 2023 | x86_64 | amazonlinux/2023 |
21-
| AmazonLinux | 2023 | arm64v8 | amazonlinux/2023.arm64v8 |
22-
| AmazonLinux | 2 | x86_64 | amazonlinux/2 |
23-
| AmazonLinux | 2 | arm64v8 | amazonlinux/2.arm64v8 |
24-
| CentOS Stream | 10 | x86_64 | centos/10 |
25-
| CentOS Stream | 10 | arm64v8 | centos/10.arm64v8 |
26-
| CentOS Stream | 9 | x86_64 | centos/9 |
27-
| CentOS Stream | 9 | arm64v8 | centos/9.arm64v8 |
28-
| CentOS | 8 | x86_64 | centos/8 |
29-
| CentOS | 8 | arm64v8 | centos/8.arm64v8 |
30-
| CentOS | 7 | x86_64 | centos/7 |
31-
| CentOS | 7 | arm64v8 | centos/7.arm64v8 |
32-
| Debian | 13 | x86_64 | debian/trixie |
33-
| Debian | 13 | arm64v8 | debian/trixie.arm64v8 |
34-
| Debian | 12 | x86_64 | debian/bookworm |
35-
| Debian | 12 | arm64v8 | debian/bookworm.arm64v8 |
36-
| Debian | 11 | x86_64 | debian/bullseye |
37-
| Debian | 11 | arm64v8 | debian/bullseye.arm64v8 |
38-
| Debian | 10 | x86_64 | debian/buster |
39-
| Debian | 10 | arm64v8 | debian/buster.arm64v8 |
40-
| openSUSE | 15.6 | x86_64 | opensuse/15.6 |
41-
| openSUSE | 15.6 | arm64v8 | opensuse/15.6.arm64v8 |
42-
| SLES | 15.7 | x86_64 | sles/15.7 |
43-
| SLES | 15.7 | arm64v8 | sles/15.7.arm64v8 |
44-
| Ubuntu | 24.04 / Noble Numbat | x86_64 | ubuntu/24.04 |
45-
| Ubuntu | 24.04 / Noble Numbat | arm64v8 | ubuntu/24.04.arm64v8 |
46-
| Ubuntu | 22.04 / Jammy Jellyfish | x86_64 | ubuntu/22.04 |
47-
| Ubuntu | 22.04 / Jammy Jellyfish | arm64v8 | ubuntu/22.04.arm64v8 |
48-
| Ubuntu | 20.04 / Focal Fossa | x86_64 | ubuntu/20.04 |
49-
| Ubuntu | 20.04 / Focal Fossa | arm64v8 | ubuntu/20.04.arm64v8 |
50-
| Ubuntu | 18.04 / Bionic Beaver | x86_64 | ubuntu/18.04 |
51-
| Ubuntu | 18.04 / Bionic Beaver | arm64v8 | ubuntu/18.04.arm64v8 |
52-
| Ubuntu | 16.04 / Xenial Xerus | x86_64 | ubuntu/16.04 |
53-
| Raspbian | 12 / Bookworm | arm32v7 | raspbian/bookworm |
54-
| Raspbian | 11 / Bullseye | arm32v7 | raspbian/bullseye |
55-
| Raspbian | 10 / Buster | arm32v7 | raspbian/buster |
56-
| Rocky Linux | 10 | x86_64 | rockylinux/10 |
57-
| Rocky Linux | 10 | arm64v8 | rockylinux/10.arm64v8 |
58-
| Rocky Linux | 9 | x86_64 | rockylinux/9 |
59-
| Rocky Linux | 9 | arm64v8 | rockylinux/9.arm64v8 |
60-
| Rocky Linux | 8 | x86_64 | rockylinux/8 |
61-
| Rocky Linux | 8 | arm64v8 | rockylinux/8.arm64v8 |
12+
| Distro | Version / Code Name | Arch | Target Option |
13+
|---------------|---------------------------|---------|----------------------------|
14+
| AlmaLinux | 10 | x86_64 | almalinux/10 |
15+
| AlmaLinux | 10 | arm64v8 | almalinux/10.arm64v8 |
16+
| AlmaLinux | 9 | x86_64 | almalinux/9 |
17+
| AlmaLinux | 9 | arm64v8 | almalinux/9.arm64v8 |
18+
| AlmaLinux | 8 | x86_64 | almalinux/8 |
19+
| AlmaLinux | 8 | arm64v8 | almalinux/8.arm64v8 |
20+
| AmazonLinux | 2023 | x86_64 | amazonlinux/2023 |
21+
| AmazonLinux | 2023 | arm64v8 | amazonlinux/2023.arm64v8 |
22+
| AmazonLinux | 2 | x86_64 | amazonlinux/2 |
23+
| AmazonLinux | 2 | arm64v8 | amazonlinux/2.arm64v8 |
24+
| CentOS Stream | 10 | x86_64 | centos/10 |
25+
| CentOS Stream | 10 | arm64v8 | centos/10.arm64v8 |
26+
| CentOS Stream | 9 | x86_64 | centos/9 |
27+
| CentOS Stream | 9 | arm64v8 | centos/9.arm64v8 |
28+
| CentOS | 8 | x86_64 | centos/8 |
29+
| CentOS | 8 | arm64v8 | centos/8.arm64v8 |
30+
| CentOS | 7 | x86_64 | centos/7 |
31+
| CentOS | 7 | arm64v8 | centos/7.arm64v8 |
32+
| Debian | 13 | x86_64 | debian/trixie |
33+
| Debian | 13 | arm64v8 | debian/trixie.arm64v8 |
34+
| Debian | 12 | x86_64 | debian/bookworm |
35+
| Debian | 12 | arm64v8 | debian/bookworm.arm64v8 |
36+
| Debian | 11 | x86_64 | debian/bullseye |
37+
| Debian | 11 | arm64v8 | debian/bullseye.arm64v8 |
38+
| Debian | 10 | x86_64 | debian/buster |
39+
| Debian | 10 | arm64v8 | debian/buster.arm64v8 |
40+
| openSUSE | 15.6 | x86_64 | opensuse/leap:15.6 |
41+
| openSUSE | 15.6 | arm64v8 | opensuse/leap:15.6.arm64v8 |
42+
| SLES | 15.7 | x86_64 | sles/15.7 |
43+
| SLES | 15.7 | arm64v8 | sles/15.7.arm64v8 |
44+
| Ubuntu | 24.04 / Noble Numbat | x86_64 | ubuntu/24.04 |
45+
| Ubuntu | 24.04 / Noble Numbat | arm64v8 | ubuntu/24.04.arm64v8 |
46+
| Ubuntu | 22.04 / Jammy Jellyfish | x86_64 | ubuntu/22.04 |
47+
| Ubuntu | 22.04 / Jammy Jellyfish | arm64v8 | ubuntu/22.04.arm64v8 |
48+
| Ubuntu | 20.04 / Focal Fossa | x86_64 | ubuntu/20.04 |
49+
| Ubuntu | 20.04 / Focal Fossa | arm64v8 | ubuntu/20.04.arm64v8 |
50+
| Ubuntu | 18.04 / Bionic Beaver | x86_64 | ubuntu/18.04 |
51+
| Ubuntu | 18.04 / Bionic Beaver | arm64v8 | ubuntu/18.04.arm64v8 |
52+
| Ubuntu | 16.04 / Xenial Xerus | x86_64 | ubuntu/16.04 |
53+
| Raspbian | 12 / Bookworm | arm32v7 | raspbian/bookworm |
54+
| Raspbian | 11 / Bullseye | arm32v7 | raspbian/bullseye |
55+
| Raspbian | 10 / Buster | arm32v7 | raspbian/buster |
56+
| Rocky Linux | 10 | x86_64 | rockylinux/10 |
57+
| Rocky Linux | 10 | arm64v8 | rockylinux/10.arm64v8 |
58+
| Rocky Linux | 9 | x86_64 | rockylinux/9 |
59+
| Rocky Linux | 9 | arm64v8 | rockylinux/9.arm64v8 |
60+
| Rocky Linux | 8 | x86_64 | rockylinux/8 |
61+
| Rocky Linux | 8 | arm64v8 | rockylinux/8.arm64v8 |
6262

6363
These container images are intended to be built from the root of this repo to build the locally checked out/updated version of the source easily for any target.
6464

packaging/build-config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@
9797
"type": "rpm"
9898
},
9999
{
100-
"target": "opensuse/15.6",
100+
"target": "opensuse/leap:15.6",
101101
"type": "rpm"
102102
},
103103
{
104-
"target": "opensuse/15.6.arm64v8",
104+
"target": "opensuse/leap:15.6.arm64v8",
105105
"type": "rpm"
106106
},
107107
{

packaging/build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,16 @@ MAIN_IMAGE="flb-$FLB_DISTRO"
5959
IMAGE_CONTEXT_DIR="$SCRIPT_DIR/distros/$FLB_DISTRO"
6060
if [[ ! -d "$SCRIPT_DIR/distros/$FLB_DISTRO" ]]; then
6161
IMAGE_CONTEXT_DIR="$SCRIPT_DIR/distros/${FLB_DISTRO%%/*}"
62-
FLB_ARG="$FLB_ARG --build-arg BASE_BUILDER=${FLB_DISTRO%%/*}-${FLB_DISTRO##*/}-base --target builder"
62+
63+
# Extract distro and version parts
64+
DISTRO_NAME=${FLB_DISTRO%%/*} # e.g., opensuse
65+
DISTRO_VERSION=${FLB_DISTRO##*/} # e.g., leap:15.6
66+
67+
# Replace invalid characters in the version part for a valid stage name
68+
CLEANED_DISTRO_VERSION=${DISTRO_VERSION/:/-}
69+
70+
# Construct the BASE_BUILDER argument using the cleaned names
71+
FLB_ARG="$FLB_ARG --build-arg BASE_BUILDER=${DISTRO_NAME}-${CLEANED_DISTRO_VERSION}-base --target builder"
6372
fi
6473

6574
if [[ ! -f "$IMAGE_CONTEXT_DIR/Dockerfile" ]]; then

packaging/distros/opensuse/15.6.arm64v8/Dockerfile

Lines changed: 0 additions & 74 deletions
This file was deleted.

packaging/distros/opensuse/15.6/Dockerfile

Lines changed: 0 additions & 69 deletions
This file was deleted.

packaging/distros/opensuse/Dockerfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,28 @@ RUN zypper up -y && \
2727
libyaml-devel && \
2828
zypper clean -a && rm -rf /var/cache/zypp/*
2929

30+
# opensuse/leap base image
31+
FROM opensuse/leap:15.6 AS opensuse-leap-15.6-base
32+
33+
# hadolint ignore=DL3033
34+
RUN zypper up -y && \
35+
zypper install -y --no-recommends \
36+
rpm-build \
37+
curl ca-certificates wget unzip flex bison \
38+
gcc gcc-c++ \
39+
cmake3-full \
40+
make \
41+
bash \
42+
systemd-devel \
43+
postgresql postgresql-devel postgresql-server \
44+
cyrus-sasl cyrus-sasl-devel \
45+
libopenssl3 libopenssl-3-devel \
46+
libyaml-devel && \
47+
zypper clean -a && rm -rf /var/cache/zypp/*
3048

3149
# opensuse/leap.arm64v8 base image
3250
# hadolint ignore=DL3029
33-
FROM --platform=arm64 opensuse/leap:15.6 AS opensuse-leap.arm64v8-base
51+
FROM --platform=arm64 opensuse/leap:15.6 AS opensuse-leap-15.6.arm64v8-base
3452

3553
COPY --from=multiarch-aarch64 /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
3654

packaging/distros/sles/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG BASE_BUILDER
55
# Multiarch support
66
FROM multiarch/qemu-user-static:x86_64-aarch64 AS multiarch-aarch64
77

8-
# opensuse/leap base image
8+
# sles base image
99
FROM registry.suse.com/bci/bci-base:15.7 AS sles-15.7-base
1010

1111
# hadolint ignore=DL3033
@@ -18,7 +18,7 @@ RUN zypper up -y && \
1818
rm -rf /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2} && \
1919
zypper clean -a
2020

21-
# opensuse/leap.arm64v8 base image
21+
# sles base image is the same name for all architectures
2222
# hadolint ignore=DL3029
2323
FROM --platform=arm64 registry.suse.com/bci/bci-base:15.7 AS sles-15.7.arm64v8-base
2424

packaging/update-repos.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ RPM_REPO_PATHS=( "amazonlinux/2"
4343
"almalinux/8"
4444
"almalinux/9"
4545
"almalinux/10"
46-
"opensuse/15.6"
46+
"opensuse/leap/15.6"
4747
"sles/15.7"
4848
)
4949

@@ -58,7 +58,14 @@ for RPM_REPO in "${RPM_REPO_PATHS[@]}"; do
5858
aws s3 sync s3://"${AWS_S3_BUCKET_STAGING:?}/$RPM_REPO" "${BASE_PATH:?}/$RPM_REPO"
5959
fi
6060

61-
/bin/bash -eux "$SCRIPT_DIR/update-yum-repo.sh"
61+
case "$RPM_REPO" in
62+
"opensuse/"* | "sles/"*)
63+
/bin/bash -eux "$SCRIPT_DIR/update-zypper-repo.sh"
64+
;;
65+
*)
66+
/bin/bash -eux "$SCRIPT_DIR/update-yum-repo.sh"
67+
;;
68+
esac
6269
done
6370

6471
DEB_REPO_PATHS=( "debian/bookworm"

0 commit comments

Comments
 (0)