-
Notifications
You must be signed in to change notification settings - Fork 47
/
Dockerfile
55 lines (43 loc) · 2.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ARG BUILDER=almalinux:8
FROM $BUILDER as builder
ENV DL_URL https://pkg.linbit.com//downloads/drbd/utils
# setup env, unfortunately ENV is too inflexible
ENV NV /tmp/env
COPY /configure.ac /tmp
RUN vers=$(grep "^AC_INIT" /tmp/configure.ac | cut -d'(' -f2 | cut -f2 -d ',' | sed 's/ //g') && test -n "$vers" && \
echo "DRBD_UTILS_VERSION=$vers" > $NV && \
echo "DRBD_UTILS_PKGNAME=drbd-utils" >> $NV && \
echo 'DRBD_UTILS_TGZ=${DRBD_UTILS_PKGNAME}-${DRBD_UTILS_VERSION}.tar.gz' >> $NV && \
echo "DRBD_UTILS_DL_TGZ=${DL_URL}"'/${DRBD_UTILS_TGZ}' >> $NV
USER root
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical # !lbbuild
RUN groupadd makepkg # !lbbuild
RUN useradd -m -g makepkg makepkg # !lbbuild
RUN yum install -y rpm-build wget gcc flex glibc-devel make automake systemd-udev && yum clean all -y # !lbbuild
RUN cd /tmp && . "$NV" && wget "$DRBD_UTILS_DL_TGZ" # !lbbuild
# =lbbuild COPY /${DRBD_UTILS_TGZ} /tmp/
USER makepkg
RUN cd ${HOME} && . "$NV" && \
cp /tmp/${DRBD_UTILS_TGZ} ${HOME} && \
mkdir -p ${HOME}/rpmbuild/SOURCES && \
cp /tmp/${DRBD_UTILS_TGZ} ${HOME}/rpmbuild/SOURCES && \
tar xvf ${DRBD_UTILS_TGZ} && \
cd ${DRBD_UTILS_PKGNAME}-${DRBD_UTILS_VERSION} && \
./configure --with-prebuiltman && make drbd.spec && \
rpmbuild -bb --define "debug_package %{nil}" \
--without drbdmon --with prebuiltman --without sbinsymlinks --without manual --without heartbeat --without xen --without 84support drbd.spec
FROM registry.access.redhat.com/ubi8/ubi
LABEL maintainer="Roland Kammerer <[email protected]>"
ENV DRBD_UTILS_VERSION 9.29.0
ARG release=1
LABEL name="drbd-utils" \
vendor="LINBIT" \
version="$DRBD_UTILS_VERSION" \
release="$release" \
summary="low level userpace interacting with the DRBD kernel module" \
description="low level userpace interacting with the DRBD kernel module"
COPY COPYING /licenses/gpl-2.0.txt
COPY --from=builder /home/makepkg/rpmbuild/RPMS/*/drbd-utils*.rpm /tmp/
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \
yum install -y /tmp/drbd-utils*.rpm && yum clean all -y
RUN echo 'global { usage-count no; }' > /etc/drbd.d/global_common.conf