Skip to content

Commit 3ea3e60

Browse files
authored
RHAIENG-495: feat(base-images/cpu): give ourselves zeromq base image (#2609)
1 parent e4acafd commit 3ea3e60

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARG TARGETARCH
2+
3+
FROM quay.io/sclorg/python-312-c9s:c9s AS buildscripts
4+
COPY base-images/utils/aipcc.sh /mnt/aipcc.sh
5+
6+
####################
7+
# base #
8+
####################
9+
FROM quay.io/sclorg/python-312-c9s:c9s AS base
10+
11+
USER 0
12+
13+
RUN \
14+
--mount=from=buildscripts,source=/mnt,target=/mnt \
15+
--mount=type=cache,sharing=locked,id=dnf-c9s,target=/var/cache/dnf \
16+
/bin/bash <<'EOF'
17+
/mnt/aipcc.sh
18+
EOF
19+
20+
# Restore user workspace
21+
USER 1001
22+
WORKDIR /opt/app-root/src
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARG TARGETARCH
2+
3+
FROM registry.access.redhat.com/ubi9/python-312:latest AS buildscripts
4+
COPY base-images/utils/aipcc.sh /mnt/aipcc.sh
5+
6+
####################
7+
# base #
8+
####################
9+
FROM registry.access.redhat.com/ubi9/python-312:latest AS base
10+
11+
USER 0
12+
13+
RUN \
14+
--mount=from=buildscripts,source=/mnt,target=/mnt \
15+
--mount=type=cache,sharing=locked,id=dnf-ubi9,target=/var/cache/dnf \
16+
/bin/bash <<'EOF'
17+
/mnt/aipcc.sh
18+
EOF
19+
20+
# Restore user workspace
21+
USER 1001
22+
WORKDIR /opt/app-root/src

base-images/utils/aipcc.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
set -Eeuxo pipefail
3+
4+
DNF_OPTS=(-y --nodocs --setopt=install_weak_deps=False --setopt=keepcache=True)
5+
6+
function install_epel() {
7+
dnf install "${DNF_OPTS[@]}" https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
8+
}
9+
10+
function uninstall_epel() {
11+
dnf remove "${DNF_OPTS[@]}" epel-release
12+
}
13+
14+
function main() {
15+
install_epel
16+
trap uninstall_epel EXIT
17+
18+
dnf install "${DNF_OPTS[@]}" zeromq
19+
if ! test -f /usr/lib64/libzmq.so.5; then
20+
echo "Error: libzmq.so.5 was not found after installation"
21+
exit 1
22+
fi
23+
}
24+
25+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
26+
main "$@"
27+
fi

0 commit comments

Comments
 (0)