diff --git a/Makefile b/Makefile index 9404ebf..4eeb4f1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SHELL := /bin/bash ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) -CHART_VER ?= 0.4.1 +CHART_VER ?= 0.4.2 DRBD_VER ?= 9.0.32-1# another tested value is: 9.1.11 DRBD_UTILS_VER ?= 9.12.1# another tested value is: 9.21.4 @@ -29,7 +29,7 @@ update_chart_ver: drbd9: cd docker-drbd9 && \ - ./build.sh $(DRBD_VER) $(ARCH) $(REG) $(IMG) + ./build.sh $(DRBD_VER) $(ARCH) $(REG) $(CHART_VER) $(IMG) compiler-centos7: for a in $(shell echo $(ARCH) | tr ',' ' '); do \ @@ -112,7 +112,7 @@ test: push: set -x; \ for i in $(IMG); do \ - [ $$i = "shipper" ] && ver=$(DRBD_VER)_v$(CHART_VER) || ver=$(DRBD_VER); \ + ver=$(DRBD_VER)_v$(CHART_VER); \ docker manifest rm $(REG)/drbd9-$$i:v$${ver}; \ for a in $(shell echo $(ARCH) | tr ',' ' ' ); do \ docker push $(REG)/drbd9-$$i:v$${ver}_$${a/\//-} || \ diff --git a/docker-drbd9/Dockerfile.bionic b/docker-drbd9/Dockerfile.bionic index 9a6b51c..cead3b3 100644 --- a/docker-drbd9/Dockerfile.bionic +++ b/docker-drbd9/Dockerfile.bionic @@ -1,24 +1,6 @@ -FROM ubuntu:bionic +From ghcr.io/hwameistor/drbd9-bionic:v9.0.32-1 -# note: py2 setuptools are a bit smaller than the py3 ones -RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch curl && \ - apt-get install -y python-setuptools && apt-get clean && \ - cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ - tar xvf master.tar.gz && \ - ( cd python-lbdist-master && python setup.py install ) && \ - rm -rf python-lbdist-master master.tar.gz - -COPY /drbd.tar.gz / - -COPY /pkgs /pkgs COPY /config-drbd.sh / COPY /entry.sh / RUN chmod +x /entry.sh - -# link python3 -RUN ln -vs /usr/bin/python2 /usr/bin/python3 -RUN ln -vs /usr/bin/python2 /usr/bin/python3.6 - ENTRYPOINT /entry.sh - -ENV DRBD_VERSION 9.1.8 diff --git a/docker-drbd9/Dockerfile.bionic.base b/docker-drbd9/Dockerfile.bionic.base new file mode 100644 index 0000000..9a6b51c --- /dev/null +++ b/docker-drbd9/Dockerfile.bionic.base @@ -0,0 +1,24 @@ +FROM ubuntu:bionic + +# note: py2 setuptools are a bit smaller than the py3 ones +RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch curl && \ + apt-get install -y python-setuptools && apt-get clean && \ + cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ + tar xvf master.tar.gz && \ + ( cd python-lbdist-master && python setup.py install ) && \ + rm -rf python-lbdist-master master.tar.gz + +COPY /drbd.tar.gz / + +COPY /pkgs /pkgs +COPY /config-drbd.sh / +COPY /entry.sh / +RUN chmod +x /entry.sh + +# link python3 +RUN ln -vs /usr/bin/python2 /usr/bin/python3 +RUN ln -vs /usr/bin/python2 /usr/bin/python3.6 + +ENTRYPOINT /entry.sh + +ENV DRBD_VERSION 9.1.8 diff --git a/docker-drbd9/Dockerfile.focal b/docker-drbd9/Dockerfile.focal index bdfad05..d103b38 100644 --- a/docker-drbd9/Dockerfile.focal +++ b/docker-drbd9/Dockerfile.focal @@ -1,24 +1,5 @@ -FROM ubuntu:focal +From ghcr.io/hwameistor/drbd9-focal:v9.0.32-1 -# note: py2 setuptools are a bit smaller than the py3 ones -RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch curl && \ - apt-get install -y python-setuptools && apt-get clean && \ - cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ - tar xvf master.tar.gz && \ - ( cd python-lbdist-master && python2 setup.py install ) && \ - rm -rf python-lbdist-master master.tar.gz - -COPY /drbd.tar.gz / - -COPY /pkgs /pkgs COPY /config-drbd.sh / COPY /entry.sh / -RUN chmod +x /entry.sh - -# link python3 -RUN ln -vs /usr/bin/python2 /usr/bin/python3 -RUN ln -vs /usr/bin/python2 /usr/bin/python3.6 - -ENTRYPOINT /entry.sh - -ENV DRBD_VERSION 9.1.8 +RUN chmod +x /entry.sh \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.focal.base b/docker-drbd9/Dockerfile.focal.base new file mode 100644 index 0000000..1797f08 --- /dev/null +++ b/docker-drbd9/Dockerfile.focal.base @@ -0,0 +1,24 @@ +FROM ubuntu:focal + +# note: py2 setuptools are a bit smaller than the py3 ones +RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch curl && \ + apt-get install -y python-setuptools && apt-get clean && \ + cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ + tar xvf master.tar.gz && \ + ( cd python-lbdist-master && python2 setup.py install ) && \ + rm -rf python-lbdist-master master.tar.gz + +COPY /drbd.tar.gz / + +COPY /pkgs /pkgs +COPY /config-drbd.sh / +COPY /entry.sh / +RUN chmod +x /entry.sh + +# link python3 +RUN ln -vs /usr/bin/python2 /usr/bin/python3 +RUN ln -vs /usr/bin/python2 /usr/bin/python3.6 + +ENTRYPOINT /entry.sh + +ENV DRBD_VERSION 9.1.8 \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.jammy b/docker-drbd9/Dockerfile.jammy index eec6879..23d1016 100644 --- a/docker-drbd9/Dockerfile.jammy +++ b/docker-drbd9/Dockerfile.jammy @@ -1,20 +1,6 @@ -FROM ubuntu:jammy +From ghcr.io/hwameistor/drbd9-jammy:v9.0.32-1 -RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch elfutils curl && \ - apt-get install -y python3-setuptools && apt-get clean && \ - cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ - tar xvf master.tar.gz && \ - ( cd python-lbdist-master && python3 setup.py install ) && \ - rm -rf python-lbdist-master master.tar.gz - -COPY /drbd.tar.gz / - -COPY /pkgs /pkgs COPY /config-drbd.sh / COPY /entry.sh / RUN chmod +x /entry.sh -ENTRYPOINT /entry.sh - -ENV DRBD_VERSION 9.1.8 - -RUN apt-get update && apt-get install -y coccinelle --fix-missing && apt-get clean +ENTRYPOINT /entry.sh \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.jammy.base b/docker-drbd9/Dockerfile.jammy.base new file mode 100644 index 0000000..5fd789b --- /dev/null +++ b/docker-drbd9/Dockerfile.jammy.base @@ -0,0 +1,20 @@ +FROM ubuntu:jammy + +RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch elfutils curl && \ + apt-get install -y python3-setuptools && apt-get clean && \ + cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ + tar xvf master.tar.gz && \ + ( cd python-lbdist-master && python3 setup.py install ) && \ + rm -rf python-lbdist-master master.tar.gz + +COPY /drbd.tar.gz / + +COPY /pkgs /pkgs +COPY /config-drbd.sh / +COPY /entry.sh / +RUN chmod +x /entry.sh +ENTRYPOINT /entry.sh + +ENV DRBD_VERSION 9.1.8 + +RUN apt-get update && apt-get install -y coccinelle --fix-missing && apt-get clean diff --git a/docker-drbd9/Dockerfile.kylin10 b/docker-drbd9/Dockerfile.kylin10 index 23266c2..f82fc2b 100644 --- a/docker-drbd9/Dockerfile.kylin10 +++ b/docker-drbd9/Dockerfile.kylin10 @@ -1,44 +1,5 @@ -FROM centos:8 AS kylin-base +From ghcr.io/hwameistor/drbd9-kylin10:v9.0.32-1 -ENV KYLIN_ROOT '/kylin/rootfs' - -COPY kylin10.repo / - -RUN set -x && \ - rm -vf /etc/yum.repos.d/*.repo && \ - cp -vf /kylin10.repo /etc/yum.repos.d/ && \ - mkdir -vp ${KYLIN_ROOT} && \ - rpm --root ${KYLIN_ROOT} --initdb && \ - yum install -y --downloadonly --downloaddir . kylin-release kylin-repos kylin-gpg-keys && \ - rpm --root ${KYLIN_ROOT} -ivh --force --nodeps kylin-release*.rpm kylin-repos*.rpm kylin-gpg-keys*.rpm && \ - rpm --root ${KYLIN_ROOT} --import ${KYLIN_ROOT}/etc/pki/rpm-gpg/RPM-GPG-KEY-kylin && \ - rm -vf *.rpm - -RUN set -x && \ - yum -y --installroot=${KYLIN_ROOT} --setopt=tsflags='nodocs' --setopt=override_install_langs=en_US.utf8 \ - install tar wget gcc make patch curl kmod cpio python3 elfutils-libelf-devel python2 hostname && \ - yum -y --installroot=${KYLIN_ROOT} clean all - -FROM scratch - -COPY --from=kylin-base /kylin/rootfs/ / - -ENV DRBD_VERSION 9.1.8 - -RUN cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ - tar xvf master.tar.gz && \ - ( cd python-lbdist-master && python setup.py install ) && \ - rm -rf python-lbdist-master master.tar.gz - -# one can not comment copy -RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz # !lbbuild -# =lbbuild COPY /drbd.tar.gz / - -# these are now the kmod pkgs: -COPY /pkgs /pkgs -COPY /drbdUtils.tar.gz / -COPY /install-drbdutils.sh / COPY /config-drbd.sh / COPY /entry.sh / -RUN chmod +x /entry.sh -ENTRYPOINT /entry.sh +RUN chmod +x /entry.sh \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.kylin10.base b/docker-drbd9/Dockerfile.kylin10.base new file mode 100644 index 0000000..3cc62e8 --- /dev/null +++ b/docker-drbd9/Dockerfile.kylin10.base @@ -0,0 +1,44 @@ +FROM centos:8 AS kylin-base + +ENV KYLIN_ROOT '/kylin/rootfs' + +COPY kylin10.repo / + +RUN set -x && \ + rm -vf /etc/yum.repos.d/*.repo && \ + cp -vf /kylin10.repo /etc/yum.repos.d/ && \ + mkdir -vp ${KYLIN_ROOT} && \ + rpm --root ${KYLIN_ROOT} --initdb && \ + yum install -y --downloadonly --downloaddir . kylin-release kylin-repos kylin-gpg-keys && \ + rpm --root ${KYLIN_ROOT} -ivh --force --nodeps kylin-release*.rpm kylin-repos*.rpm kylin-gpg-keys*.rpm && \ + rpm --root ${KYLIN_ROOT} --import ${KYLIN_ROOT}/etc/pki/rpm-gpg/RPM-GPG-KEY-kylin && \ + rm -vf *.rpm + +RUN set -x && \ + yum -y --installroot=${KYLIN_ROOT} --setopt=tsflags='nodocs' --setopt=override_install_langs=en_US.utf8 \ + install tar wget gcc make patch curl kmod cpio python3 elfutils-libelf-devel python2 hostname && \ + yum -y --installroot=${KYLIN_ROOT} clean all + +FROM scratch + +COPY --from=kylin-base /kylin/rootfs/ / + +ENV DRBD_VERSION 9.1.8 + +RUN cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ + tar xvf master.tar.gz && \ + ( cd python-lbdist-master && python setup.py install ) && \ + rm -rf python-lbdist-master master.tar.gz + +# one can not comment copy +RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz # !lbbuild +# =lbbuild COPY /drbd.tar.gz / + +# these are now the kmod pkgs: +COPY /pkgs /pkgs +COPY /drbdUtils.tar.gz / +COPY /install-drbdutils.sh / +COPY /config-drbd.sh / +COPY /entry.sh / +RUN chmod +x /entry.sh +ENTRYPOINT /entry.sh \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.rhel7 b/docker-drbd9/Dockerfile.rhel7 index f190272..61495ef 100644 --- a/docker-drbd9/Dockerfile.rhel7 +++ b/docker-drbd9/Dockerfile.rhel7 @@ -1,40 +1,6 @@ -# FROM registry.access.redhat.com/ubi7/ubi -# Change to CentOS because Ubi7 does not support linux/arm6 -FROM centos:7 -MAINTAINER Roland Kammerer +From ghcr.io/hwameistor/drbd9-rhel7:v9.0.32-1 -ENV DRBD_VERSION 9.1.8 - -ARG release=1 -LABEL name="DRBD Kernel module load container" \ - vendor="LINBIT" \ - version="$DRBD_VERSION" \ - release="$release" \ - summary="DRBD's kernel component" \ - description="DRBD's kernel component" -RUN mkdir /licenses && cp /usr/share/licenses/shadow-utils-4.6/gpl-2.0.txt /licenses/ - -RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ - yum install -y wget gcc make patch curl kmod yum-utils python-setuptools && yum clean all -y && \ - cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ - tar xvf master.tar.gz && \ - ( cd python-lbdist-master && python setup.py install ) && \ - rm -rf python-lbdist-master master.tar.gz - -# one can not comment copy -RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz # !lbbuild -# =lbbuild COPY /drbd.tar.gz / - -COPY /pkgs /pkgs COPY /config-drbd.sh / COPY /entry.sh / RUN chmod +x /entry.sh - -# link python3, install hostname -RUN ln -vs /usr/bin/python /usr/bin/python3 && \ - ln -vs /usr/bin/python /usr/bin/python3.6 && \ - yum install -y hostname && yum clean all -y - -RUN yum install -y util-linux - ENTRYPOINT /entry.sh diff --git a/docker-drbd9/Dockerfile.rhel7.base b/docker-drbd9/Dockerfile.rhel7.base new file mode 100644 index 0000000..f190272 --- /dev/null +++ b/docker-drbd9/Dockerfile.rhel7.base @@ -0,0 +1,40 @@ +# FROM registry.access.redhat.com/ubi7/ubi +# Change to CentOS because Ubi7 does not support linux/arm6 +FROM centos:7 +MAINTAINER Roland Kammerer + +ENV DRBD_VERSION 9.1.8 + +ARG release=1 +LABEL name="DRBD Kernel module load container" \ + vendor="LINBIT" \ + version="$DRBD_VERSION" \ + release="$release" \ + summary="DRBD's kernel component" \ + description="DRBD's kernel component" +RUN mkdir /licenses && cp /usr/share/licenses/shadow-utils-4.6/gpl-2.0.txt /licenses/ + +RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ + yum install -y wget gcc make patch curl kmod yum-utils python-setuptools && yum clean all -y && \ + cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ + tar xvf master.tar.gz && \ + ( cd python-lbdist-master && python setup.py install ) && \ + rm -rf python-lbdist-master master.tar.gz + +# one can not comment copy +RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz # !lbbuild +# =lbbuild COPY /drbd.tar.gz / + +COPY /pkgs /pkgs +COPY /config-drbd.sh / +COPY /entry.sh / +RUN chmod +x /entry.sh + +# link python3, install hostname +RUN ln -vs /usr/bin/python /usr/bin/python3 && \ + ln -vs /usr/bin/python /usr/bin/python3.6 && \ + yum install -y hostname && yum clean all -y + +RUN yum install -y util-linux + +ENTRYPOINT /entry.sh diff --git a/docker-drbd9/Dockerfile.rhel8 b/docker-drbd9/Dockerfile.rhel8 index 3cabe0a..c139c57 100644 --- a/docker-drbd9/Dockerfile.rhel8 +++ b/docker-drbd9/Dockerfile.rhel8 @@ -1,58 +1,5 @@ -ARG EXTRAPKGS=almalinux:8 -FROM $EXTRAPKGS as extrapkgs -# by checking for /pkgs we can cache that step -# and prepare images that already contain the packages. -RUN mkdir /pkgs -RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel && rm -f *.i686.rpm # !lbbuild +From ghcr.io/hwameistor/drbd9-rhel8:v9.0.32-1 -FROM registry.access.redhat.com/ubi8/ubi -MAINTAINER Roland Kammerer - -ENV DRBD_VERSION 9.1.8 - -ARG release=1 -LABEL name="DRBD Kernel module load container" \ - vendor="LINBIT" \ - version="$DRBD_VERSION" \ - release="$release" \ - summary="DRBD's kernel component" \ - description="DRBD's kernel component" -RUN mkdir /licenses && cp /usr/share/licenses/shadow-utils/gpl-2.0.txt /licenses/ - -# RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ -# yum install -y wget gcc make patch curl kmod cpio python3 python3-pip && yum clean all -y && \ -# alternatives --set python /usr/bin/python3 && \ -# pip-3 install https://github.com/LINBIT/python-lbdist/archive/master.tar.gz - -RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ - yum install -y wget gcc make patch curl kmod cpio python3 && yum clean all -y - -RUN alternatives --set python /usr/bin/python3 && cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ - tar xvf master.tar.gz && \ - ( cd python-lbdist-master && python setup.py install ) && \ - rm -rf python-lbdist-master master.tar.gz - -COPY --from=extrapkgs /pkgs /pkgs -#RUN yum install -y /pkgs/*.rpm # !lbbuild -RUN yum install -y --skip-broken /pkgs/*.rpm -# or -# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel - -RUN rm -rf /pkgs - -# one can not comment copy -RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz # !lbbuild -# =lbbuild COPY /drbd.tar.gz / - -# these are now the kmod pkgs: -COPY /pkgs /pkgs COPY /config-drbd.sh / COPY /entry.sh / -RUN chmod +x /entry.sh - -# add python2 hostname -RUN yum install -y python2 hostname && yum clean all -y - -RUN yum install -y util-linux - -ENTRYPOINT /entry.sh +RUN chmod +x /entry.sh \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.rhel8.base b/docker-drbd9/Dockerfile.rhel8.base new file mode 100644 index 0000000..550c97d --- /dev/null +++ b/docker-drbd9/Dockerfile.rhel8.base @@ -0,0 +1,58 @@ +ARG EXTRAPKGS=almalinux:8 +FROM $EXTRAPKGS as extrapkgs +# by checking for /pkgs we can cache that step +# and prepare images that already contain the packages. +RUN mkdir /pkgs +RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel && rm -f *.i686.rpm # !lbbuild + +FROM registry.access.redhat.com/ubi8/ubi +MAINTAINER Roland Kammerer + +ENV DRBD_VERSION 9.1.8 + +ARG release=1 +LABEL name="DRBD Kernel module load container" \ + vendor="LINBIT" \ + version="$DRBD_VERSION" \ + release="$release" \ + summary="DRBD's kernel component" \ + description="DRBD's kernel component" +RUN mkdir /licenses && cp /usr/share/licenses/shadow-utils/gpl-2.0.txt /licenses/ + +# RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ +# yum install -y wget gcc make patch curl kmod cpio python3 python3-pip && yum clean all -y && \ +# alternatives --set python /usr/bin/python3 && \ +# pip-3 install https://github.com/LINBIT/python-lbdist/archive/master.tar.gz + +RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ + yum install -y wget gcc make patch curl kmod cpio python3 && yum clean all -y + +RUN alternatives --set python /usr/bin/python3 && cd /tmp && wget https://github.com/LINBIT/python-lbdist/archive/master.tar.gz && \ + tar xvf master.tar.gz && \ + ( cd python-lbdist-master && python setup.py install ) && \ + rm -rf python-lbdist-master master.tar.gz + +COPY --from=extrapkgs /pkgs /pkgs +#RUN yum install -y /pkgs/*.rpm # !lbbuild +RUN yum install -y --skip-broken /pkgs/*.rpm +# or +# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel + +RUN rm -rf /pkgs + +# one can not comment copy +RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz # !lbbuild +# =lbbuild COPY /drbd.tar.gz / + +# these are now the kmod pkgs: +COPY /pkgs /pkgs +COPY /config-drbd.sh / +COPY /entry.sh / +RUN chmod +x /entry.sh + +# add python2 hostname +RUN yum install -y python2 hostname && yum clean all -y + +RUN yum install -y util-linux + +ENTRYPOINT /entry.sh \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.rhel9 b/docker-drbd9/Dockerfile.rhel9 index 587f668..fe29494 100644 --- a/docker-drbd9/Dockerfile.rhel9 +++ b/docker-drbd9/Dockerfile.rhel9 @@ -1,49 +1,5 @@ -ARG EXTRAPKGS=almalinux:9 -FROM $EXTRAPKGS as extrapkgs -# by checking for /pkgs we can cache that step -# and prepare images that already contain the packages. -RUN mkdir /pkgs -RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel && rm -f *.i686.rpm # !lbbuild +From ghcr.io/hwameistor/drbd9-rhel9:v9.0.32-1 -FROM registry.access.redhat.com/ubi9/ubi -MAINTAINER Roland Kammerer - -ENV DRBD_VERSION 9.1.8 - -ARG release=1 -LABEL name="DRBD Kernel module load container" \ - vendor="LINBIT" \ - version="$DRBD_VERSION" \ - release="$release" \ - summary="DRBD's kernel component" \ - description="DRBD's kernel component" -RUN mkdir /licenses && cp /usr/share/licenses/shadow-utils/gpl-2.0.txt /licenses/ - -RUN dnf -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ - dnf install -y gcc make patch kmod cpio python3 python3-pip && dnf clean all -y && \ - pip-3 install https://github.com/LINBIT/python-lbdist/archive/master.tar.gz - -COPY --from=extrapkgs /pkgs /pkgs -#RUN dnf install -y /pkgs/*.rpm # !lbbuild -RUN dnf install -y --skip-broken /pkgs/*.rpm # !lbbuild -# or -# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel - -RUN rm -rf /pkgs - -# one can not comment copy -RUN curl -fsSL https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -o /drbd.tar.gz # !lbbuild -# =lbbuild COPY /drbd.tar.gz / - -# these are now the kmod pkgs: -COPY /pkgs /pkgs COPY /config-drbd.sh / COPY /entry.sh / -RUN chmod +x /entry.sh - -# add hostname -RUN yum install -y hostname && yum clean all -y - -RUN yum install -y util-linux - -ENTRYPOINT /entry.sh +RUN chmod +x /entry.sh \ No newline at end of file diff --git a/docker-drbd9/Dockerfile.rhel9.base b/docker-drbd9/Dockerfile.rhel9.base new file mode 100644 index 0000000..1b11d1b --- /dev/null +++ b/docker-drbd9/Dockerfile.rhel9.base @@ -0,0 +1,49 @@ +ARG EXTRAPKGS=almalinux:9 +FROM $EXTRAPKGS as extrapkgs +# by checking for /pkgs we can cache that step +# and prepare images that already contain the packages. +RUN mkdir /pkgs +RUN dnf install -y 'dnf-command(download)' && cd /pkgs && dnf download elfutils-libelf-devel && rm -f *.i686.rpm # !lbbuild + +FROM registry.access.redhat.com/ubi9/ubi +MAINTAINER Roland Kammerer + +ENV DRBD_VERSION 9.1.8 + +ARG release=1 +LABEL name="DRBD Kernel module load container" \ + vendor="LINBIT" \ + version="$DRBD_VERSION" \ + release="$release" \ + summary="DRBD's kernel component" \ + description="DRBD's kernel component" +RUN mkdir /licenses && cp /usr/share/licenses/shadow-utils/gpl-2.0.txt /licenses/ + +RUN dnf -y update-minimal --security --sec-severity=Important --sec-severity=Critical && \ + dnf install -y gcc make patch kmod cpio python3 python3-pip && dnf clean all -y && \ + pip-3 install https://github.com/LINBIT/python-lbdist/archive/master.tar.gz + +COPY --from=extrapkgs /pkgs /pkgs +#RUN dnf install -y /pkgs/*.rpm # !lbbuild +RUN dnf install -y --skip-broken /pkgs/*.rpm # !lbbuild +# or +# =lbbuild RUN curl -fsSL https://nexus.at.linbit.com/repository/lbbuild/from_rhel_repos.sh | bash -s -- elfutils-libelf-devel + +RUN rm -rf /pkgs + +# one can not comment copy +RUN curl -fsSL https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VERSION}.tar.gz -o /drbd.tar.gz # !lbbuild +# =lbbuild COPY /drbd.tar.gz / + +# these are now the kmod pkgs: +COPY /pkgs /pkgs +COPY /config-drbd.sh / +COPY /entry.sh / +RUN chmod +x /entry.sh + +# add hostname +RUN yum install -y hostname && yum clean all -y + +RUN yum install -y util-linux + +ENTRYPOINT /entry.sh \ No newline at end of file diff --git a/docker-drbd9/build.sh b/docker-drbd9/build.sh index 68192a7..1a657bc 100755 --- a/docker-drbd9/build.sh +++ b/docker-drbd9/build.sh @@ -3,6 +3,7 @@ DRBD_VER=${1:-9.0.32-1} ARCH=${2:-linux/amd64} REG=${3:-daocloud.io/daocloud} +CHART_VER=${4:-0.4.2} [ -z "$DRBD_VER" ] && echo "Need a DRBD version !" && exit 1 @@ -16,8 +17,9 @@ cp -vf drbd-${DRBD_VER}.tar.gz drbd.tar.gz echo $ARCH | sed "s#,# #g" -shift 3 +shift 4 #--progress auto --progress plain --progress tty +VER="${DRBD_VER}_v${CHART_VER}" for i in $@; do df="Dockerfile.${i}" [ -f "$df" ] || continue @@ -26,7 +28,7 @@ for i in $@; do docker build . -f - \ --platform $a \ --progress auto \ - -t ${REG}/drbd9-${i##*.}:v${DRBD_VER}_${a/\//-} \ + -t ${REG}/drbd9-${i##*.}:v${VER}_${a/\//-} \ || exit 1 done done diff --git a/docker-drbd9/entry.sh b/docker-drbd9/entry.sh index 6489d6c..292010f 100644 --- a/docker-drbd9/entry.sh +++ b/docker-drbd9/entry.sh @@ -130,11 +130,13 @@ kos::fromsrc() { cd drbd-* || die "Could not cd to drbd src dir" make $LB_MAKEOPTS - #cp /drbdUtils.tar.gz /pkgs_root/drbd-utils.tar.gz - tar xf /drbdUtils.tar.gz -C /pkgs_root/ - cp /install-drbdutils.sh /pkgs_root/install-drbdutils.sh - nsenter --target 1 --mount --uts --ipc --net --pid chmod +x /root/install-drbdutils.sh - nsenter --target 1 --mount --uts --ipc --net --pid /root/install-drbdutils.sh + if [[ $OS_HOST_DIST == 'kylin10' ]]; then + #cp /drbdUtils.tar.gz /pkgs_root/drbd-utils.tar.gz + tar xf /drbdUtils.tar.gz -C /pkgs_root/ + cp /install-drbdutils.sh /pkgs_root/install-drbdutils.sh + nsenter --target 1 --mount --uts --ipc --net --pid chmod +x /root/install-drbdutils.sh + nsenter --target 1 --mount --uts --ipc --net --pid /root/install-drbdutils.sh + fi } kos::rpm::extract() { @@ -247,7 +249,7 @@ fi if [ -z "$OS_KERNEL" ]; then debug "The system parameters are obtained successfully (OS_KERNEL)" exit 1 - fi +fi var1="$OS_KERNEL" matchvar="${var1}.rpm" @@ -284,9 +286,8 @@ else matchvar="${var1}.deb" drbd_deb=$(find "$DEBDIR" -type f -name "*${matchvar}" -print -quit) utils_deb=$(find "$DEBDIR" -type f -name "drbd-utils*" -print -quit) - if [[ -n "$drbd_deb" && -n "$utils_deb" ]]; then + if [[ -n "$drbd_deb" ]]; then cp $drbd_deb /pkgs_root/drbd.deb - cp $utils_deb /pkgs_root/drbd_utils.deb cp $DEBDIR/install_deb.sh /pkgs_root/install_deb.sh #nsenter --target 1 --mount --uts --ipc --net --pid apt install -y /root/drbd_utils.deb nsenter --target 1 --mount --uts --ipc --net --pid apt install -y expect @@ -378,8 +379,5 @@ fi grep -q '^drbd_transport_tcp' /proc/modules || die "Could not load DRBD kernel modules" -cp /config-drbd.sh /pkgs_root/config-drbd.sh -nsenter --target 1 --mount --uts --ipc --net --pid chmod +x /root/config-drbd.sh -nsenter --target 1 --mount --uts --ipc --net --pid /root/config-drbd.sh print_drbd_version_and_exit diff --git a/docker-shipper/Dockerfile.shipper b/docker-shipper/Dockerfile.shipper index 9cfaac6..4193513 100644 --- a/docker-shipper/Dockerfile.shipper +++ b/docker-shipper/Dockerfile.shipper @@ -1,134 +1,7 @@ -ARG DRBD_VER +From ghcr.io/hwameistor/drbd9-shipper:v9.0.32-1_v0.4.1 -FROM centos:7 AS compiler-centos7 +COPY ./entrypoint.adapter.sh /files/ -RUN yum install -y --nogpgcheck wget kernel-abi-whitelists gcc flex glibc-devel make automake rpm-build which && \ - yum -y clean all - -# Install kernel-devels of each CentOS 7 major release -# Must rpm install a kernel-devel for prereq -COPY kernel-devels.centos7 /pkgs/ -RUN echo "centos7 arch:$(arch)" -RUN cat /pkgs/kernel-devels.centos7 | grep -v ^# | grep -w $(arch) | awk '{print $1}' | xargs -tI % mkdir -vp /pkgs/% && \ - cat /pkgs/kernel-devels.centos7 | grep -v ^# | grep -w $(arch) | awk '{print $3}' | xargs -tI % wget % --no-check-certificate && \ - ls -1 *.rpm | head -1 | xargs -tI % rpm -ivh % --nopreun --nopostun --force && \ - ls -1 *.rpm | tail -n+2 | xargs -tI % sh -xc 'rpm2cpio % | cpio -idm' && \ - rm -vf *.rpm - -# Compile kmod-drbd for each CentOS 7 major release -ARG DRBD_VER -RUN wget --no-check-certificate https://pkg.linbit.com//downloads/drbd/"$([[ $DRBD_VER =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VER}.tar.gz && \ - tar -zxf drbd-${DRBD_VER}.tar.gz -RUN mkdir -vp ~/rpmbuild/SOURCES && cd drbd-${DRBD_VER} && \ - ls -d /usr/src/kernels/* | grep -v debug | xargs -tI % make kmp-rpm KDIR=% - -RUN set -x && \ - rm -vf ~/rpmbuild/RPMS/$(arch)/kmod-drbd-debuginfo* && \ - cat /pkgs/kernel-devels.centos7 | grep -v ^# | grep $(arch) | \ - { while read -r line; do \ - dir=$( echo "$line" | awk '{print $1}' ); \ - ker=$( echo "$line" | awk '{print $2}' ); \ - mv -v ~/rpmbuild/RPMS/$(arch)/kmod-drbd*${ker/-/_}*.rpm /pkgs/${dir}/ || exit 1; \ - done } - -FROM centos:8 AS compiler-centos8 - -RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* -RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* -RUN yum install -y --nogpgcheck wget elfutils-libelf-devel kernel-rpm-macros kernel-abi-whitelists gcc flex glibc-devel make automake rpm-build which && \ - yum install -y --nogpgcheck patch kmod cpio python3 python3-pip git openssl && \ - yum install -y curl m4 openssl-devel ncurses-devel && \ - yum -y clean all - -RUN dnf -y install bubblewrap unzip -COPY /install_opam.sh / -RUN chmod +x /install_opam.sh && /install_opam.sh -RUN opam init -y -RUN opam switch create 5.1.1 -RUN opam install -y ocaml-lsp-server odoc ocamlformat utop - -RUN git clone https://github.com/coccinelle/coccinelle.git -RUN cd coccinelle && opam switch 5.1.1 && eval $(opam env) && ./autogen && ./configure && make && make install - -# Install kernel-devels of each CentOS 8 major release -# Must rpm install a kernel-devel for prereq -COPY kernel-devels.centos8 /pkgs/ -RUN echo "centos8 arch:$(arch)" -RUN cat /pkgs/kernel-devels.centos8 | grep -v ^# | grep $(arch) | awk '{print $1}' | xargs -tI % mkdir -vp /pkgs/% && \ - #sed "s/x86_64/$(arch)/g" /pkgs/kernel-devels.centos8 | grep -v ^# | awk '{print $3}' | xargs -tI % wget % --no-check-certificate && \ - cat /pkgs/kernel-devels.centos8 | grep -v ^# | grep -w $(arch) | awk '{print $3}' | xargs -tI % wget % --no-check-certificate && \ - ls -1 *.rpm | head -1 | xargs -tI % rpm -ivh % --nopreun --nopostun --force && \ - ls -1 *.rpm | tail -n+2 | xargs -tI % sh -xc 'rpm2cpio % | cpio -idm' && \ - rm -vf *.rpm - -# Compile kmod-drbd for each CentOS 8 major release -ARG DRBD_VER -RUN wget --no-check-certificate https://pkg.linbit.com//downloads/drbd/"$([[ $DRBD_VER =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VER}.tar.gz && \ - tar -zxf drbd-${DRBD_VER}.tar.gz - -RUN mkdir -vp ~/rpmbuild/SOURCES && cd drbd-${DRBD_VER} && \ - ls -d /usr/src/kernels/* | grep -v debug | xargs -tI % make kmp-rpm KDIR=% - -RUN set -x && \ - rm -vf ~/rpmbuild/RPMS/$(arch)/kmod-drbd-debuginfo* && \ - cat /pkgs/kernel-devels.centos8 | grep -v ^# | grep $(arch) | \ - { while read -r line; do \ - dir=$( echo "$line" | awk '{print $1}' ); \ - ker=$( echo "$line" | awk '{print $2}' ); \ - mv -v ~/rpmbuild/RPMS/$(arch)/kmod-drbd-[0-9]*${ker/-/_}*.rpm /pkgs/${dir}/ || exit 1; \ - done } - - -FROM ubuntu:focal as compiler-utils - -RUN apt-get update && \ - apt-get install -y build-essential wget flex automake git && \ - apt-get clean - -# Compile drbd-utils statically for all Linux distros -ARG DRBD_UTILS_VER - -ARG DRBD_HEADERS_SHA - -RUN set -x && \ - git clone -n https://github.com/LINBIT/drbd-utils.git && \ - cd drbd-utils/ && \ - git checkout v${DRBD_UTILS_VER} && \ - rm -vfr drbd-headers && \ - git clone -n https://github.com/LINBIT/drbd-headers.git && \ - cd drbd-headers/ && \ - git checkout ${DRBD_HEADERS_SHA} - -RUN set -x && \ - cd /drbd-utils && \ - ./autogen.sh && \ - ./configure \ - --with-prebuiltman \ - -with-drbdmon \ - --without-manual \ - --without-xen \ - --without-heartbeat \ - --sysconfdir=/etc \ - --localstatedir=/var \ - CFLAGS="-static" \ - LDFLAGS="-static" && \ - make tools && \ - mkdir -v /utils && \ - find ./user -type f -executable -name 'drbd[a-z]*' -exec mv -v {} /utils/ \; - -# Create shipper -FROM alpine - -ARG DRBD_VER - -COPY --from=compiler-centos7 /pkgs/ /files/ - -COPY --from=compiler-centos8 /pkgs/ /files/ - -COPY --from=compiler-utils /utils /files/utils - -COPY . /files/ - -RUN chmod -v +x /files/entrypoint.adapter.sh /files/drbd.modules +RUN chmod -v +x /files/entrypoint.adapter.sh CMD mv -vf /files/* /pkgs/ diff --git a/docker-shipper/Dockerfile.shipper.base b/docker-shipper/Dockerfile.shipper.base new file mode 100644 index 0000000..a914905 --- /dev/null +++ b/docker-shipper/Dockerfile.shipper.base @@ -0,0 +1,134 @@ +ARG DRBD_VER + +FROM centos:7 AS compiler-centos7 + +RUN yum install -y --nogpgcheck wget kernel-abi-whitelists gcc flex glibc-devel make automake rpm-build which && \ + yum -y clean all + +# Install kernel-devels of each CentOS 7 major release +# Must rpm install a kernel-devel for prereq +COPY kernel-devels.centos7 /pkgs/ +RUN echo "centos7 arch:$(arch)" +RUN cat /pkgs/kernel-devels.centos7 | grep -v ^# | grep -w $(arch) | awk '{print $1}' | xargs -tI % mkdir -vp /pkgs/% && \ + cat /pkgs/kernel-devels.centos7 | grep -v ^# | grep -w $(arch) | awk '{print $3}' | xargs -tI % wget % --no-check-certificate && \ + ls -1 *.rpm | head -1 | xargs -tI % rpm -ivh % --nopreun --nopostun --force && \ + ls -1 *.rpm | tail -n+2 | xargs -tI % sh -xc 'rpm2cpio % | cpio -idm' && \ + rm -vf *.rpm + +# Compile kmod-drbd for each CentOS 7 major release +ARG DRBD_VER +RUN wget --no-check-certificate https://pkg.linbit.com//downloads/drbd/"$([[ $DRBD_VER =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VER}.tar.gz && \ + tar -zxf drbd-${DRBD_VER}.tar.gz +RUN mkdir -vp ~/rpmbuild/SOURCES && cd drbd-${DRBD_VER} && \ + ls -d /usr/src/kernels/* | grep -v debug | xargs -tI % make kmp-rpm KDIR=% + +RUN set -x && \ + rm -vf ~/rpmbuild/RPMS/$(arch)/kmod-drbd-debuginfo* && \ + cat /pkgs/kernel-devels.centos7 | grep -v ^# | grep $(arch) | \ + { while read -r line; do \ + dir=$( echo "$line" | awk '{print $1}' ); \ + ker=$( echo "$line" | awk '{print $2}' ); \ + mv -v ~/rpmbuild/RPMS/$(arch)/kmod-drbd*${ker/-/_}*.rpm /pkgs/${dir}/ || exit 1; \ + done } + +FROM centos:8 AS compiler-centos8 + +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* +RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* +RUN yum install -y --nogpgcheck wget elfutils-libelf-devel kernel-rpm-macros kernel-abi-whitelists gcc flex glibc-devel make automake rpm-build which && \ + yum install -y --nogpgcheck patch kmod cpio python3 python3-pip git openssl && \ + yum install -y curl m4 openssl-devel ncurses-devel && \ + yum -y clean all + +RUN dnf -y install bubblewrap unzip +COPY /install_opam.sh / +RUN chmod +x /install_opam.sh && /install_opam.sh +RUN opam init -y +RUN opam switch create 5.1.1 +RUN opam install -y ocaml-lsp-server odoc ocamlformat utop + +RUN git clone https://github.com/coccinelle/coccinelle.git +RUN cd coccinelle && opam switch 5.1.1 && eval $(opam env) && ./autogen && ./configure && make && make install + +# Install kernel-devels of each CentOS 8 major release +# Must rpm install a kernel-devel for prereq +COPY kernel-devels.centos8 /pkgs/ +RUN echo "centos8 arch:$(arch)" +RUN cat /pkgs/kernel-devels.centos8 | grep -v ^# | grep $(arch) | awk '{print $1}' | xargs -tI % mkdir -vp /pkgs/% && \ + #sed "s/x86_64/$(arch)/g" /pkgs/kernel-devels.centos8 | grep -v ^# | awk '{print $3}' | xargs -tI % wget % --no-check-certificate && \ + cat /pkgs/kernel-devels.centos8 | grep -v ^# | grep -w $(arch) | awk '{print $3}' | xargs -tI % wget % --no-check-certificate && \ + ls -1 *.rpm | head -1 | xargs -tI % rpm -ivh % --nopreun --nopostun --force && \ + ls -1 *.rpm | tail -n+2 | xargs -tI % sh -xc 'rpm2cpio % | cpio -idm' && \ + rm -vf *.rpm + +# Compile kmod-drbd for each CentOS 8 major release +ARG DRBD_VER +RUN wget --no-check-certificate https://pkg.linbit.com//downloads/drbd/"$([[ $DRBD_VER =~ ^9.0 ]] && echo 9.0 || echo 9 )"/drbd-${DRBD_VER}.tar.gz && \ + tar -zxf drbd-${DRBD_VER}.tar.gz + +RUN mkdir -vp ~/rpmbuild/SOURCES && cd drbd-${DRBD_VER} && \ + ls -d /usr/src/kernels/* | grep -v debug | xargs -tI % make kmp-rpm KDIR=% + +RUN set -x && \ + rm -vf ~/rpmbuild/RPMS/$(arch)/kmod-drbd-debuginfo* && \ + cat /pkgs/kernel-devels.centos8 | grep -v ^# | grep $(arch) | \ + { while read -r line; do \ + dir=$( echo "$line" | awk '{print $1}' ); \ + ker=$( echo "$line" | awk '{print $2}' ); \ + mv -v ~/rpmbuild/RPMS/$(arch)/kmod-drbd-[0-9]*${ker/-/_}*.rpm /pkgs/${dir}/ || exit 1; \ + done } + + +FROM ubuntu:focal as compiler-utils + +RUN apt-get update && \ + apt-get install -y build-essential wget flex automake git && \ + apt-get clean + +# Compile drbd-utils statically for all Linux distros +ARG DRBD_UTILS_VER + +ARG DRBD_HEADERS_SHA + +RUN set -x && \ + git clone -n https://github.com/LINBIT/drbd-utils.git && \ + cd drbd-utils/ && \ + git checkout v${DRBD_UTILS_VER} && \ + rm -vfr drbd-headers && \ + git clone -n https://github.com/LINBIT/drbd-headers.git && \ + cd drbd-headers/ && \ + git checkout ${DRBD_HEADERS_SHA} + +RUN set -x && \ + cd /drbd-utils && \ + ./autogen.sh && \ + ./configure \ + --with-prebuiltman \ + -with-drbdmon \ + --without-manual \ + --without-xen \ + --without-heartbeat \ + --sysconfdir=/etc \ + --localstatedir=/var \ + CFLAGS="-static" \ + LDFLAGS="-static" && \ + make tools && \ + mkdir -v /utils && \ + find ./user -type f -executable -name 'drbd[a-z]*' -exec mv -v {} /utils/ \; + +# Create shipper +FROM alpine + +ARG DRBD_VER + +COPY --from=compiler-centos7 /pkgs/ /files/ + +COPY --from=compiler-centos8 /pkgs/ /files/ + +COPY --from=compiler-utils /utils /files/utils + +COPY . /files/ + +RUN chmod -v +x /files/entrypoint.adapter.sh /files/drbd.modules + +CMD mv -vf /files/* /pkgs/ diff --git a/docker-shipper/drbd-debs/drbd-utils_9.27.0-1ppa1~focal1_amd64.deb b/docker-shipper/drbd-debs/drbd-utils_9.27.0-1ppa1~focal1_amd64.deb deleted file mode 100644 index f41a8f8..0000000 Binary files a/docker-shipper/drbd-debs/drbd-utils_9.27.0-1ppa1~focal1_amd64.deb and /dev/null differ diff --git a/docker-shipper/drbd-debs/install_deb.sh b/docker-shipper/drbd-debs/install_deb.sh index b0b70d3..0aefa69 100755 --- a/docker-shipper/drbd-debs/install_deb.sh +++ b/docker-shipper/drbd-debs/install_deb.sh @@ -1,11 +1,10 @@ #!/usr/bin/expect -f -set install_cmd1 "apt install -y /root/drbd_utils.deb" -set install_cmd2 "apt install -y /root/drbd.deb" +set install_cmd "apt install -y /root/drbd.deb" set timeout 600 -spawn sh -c $install_cmd1 +spawn sh -c $install_cmd expect { "Configuration file '/etc/drbd.conf'" { send "Y\r" @@ -15,19 +14,6 @@ expect { # 处理超时情况的操作,或者留空以忽略超时 } eof { - # 第一个安装命令结束后的处理逻辑 - spawn sh -c $install_cmd2 - expect { - "Configuration file '/etc/drbd.conf'" { - send "Y\r" - exp_continue - } - timeout { - # 处理超时情况的操作,或者留空以忽略超时 - } - eof { - # 第二个安装命令结束后的处理逻辑 - } - } + # 安装命令结束后的处理逻辑 } } diff --git a/docker-shipper/entrypoint.adapter.sh b/docker-shipper/entrypoint.adapter.sh index de4ba97..0570c31 100755 --- a/docker-shipper/entrypoint.adapter.sh +++ b/docker-shipper/entrypoint.adapter.sh @@ -56,16 +56,18 @@ echo "OS_KERNEL:$1" export DRBD_EXIST='no' export DRBD_RMP_INSTALL='no' export OS_KERNEL=$1 +export OS_HOST_DIST=$host_dist + if [[ $host_dist == 'kylin10' ]]; then LB_HOW=compile else LB_HOW=shipped_modules fi if [[ $LB_HOW == 'shipped_modules' ]]; then - source /entry.sh + bash -x /entry.sh echo "Successfully loaded shipped module" elif [[ $LB_HOW == 'compile' ]]; then - source /entry.sh + bash -x /entry.sh echo "Successfully loaded compiled module" fi diff --git a/helm/drbd-adapter/Chart.yaml b/helm/drbd-adapter/Chart.yaml index e2bef0d..5b86114 100644 --- a/helm/drbd-adapter/Chart.yaml +++ b/helm/drbd-adapter/Chart.yaml @@ -4,7 +4,7 @@ description: A DRBD kernel loader that auto-adapts OS distros type: application -version: v0.4.1 +version: v0.4.2 appVersion: v9.0.32