Open mykaul opened 3 years ago
Optimized Dockerfile and startscript as below. We need to pull the already built docker image from quay and run only the daily build to generate rpms, that way it looks optimised from my point of view.
===============================Dockerfile============================== FROM centos:8
LABEL project="centos8-gluster-build" LABEL maintainer "gluster-users@gluster.org"
RUN yum -y --setopt tsflags=nodocs --enablerepo=powertools install automake autoconf libtool flex bison \ openssl-devel libxml2-devel libaio-devel \ readline-devel lvm2-devel glib2-devel userspace-rcu-devel libcmocka-devel \ libacl-devel fuse-devel redhat-rpm-config rpcgen libtirpc-devel \ make python3-devel rsync libuuid-devel rpm-build perl-Test-Harness \ git attr libcurl-devel selinux-policy-devel firewalld liburing-devel rpcgen -y
RUN dnf -y install epel-release --setopt tsflags=nodocs
RUN yum -y update --setopt tsflags=nodocs
RUN yum clean all
CMD ["/usr/sbin/init"]
COPY ./startscript.sh /
RUN chmod +x /startscript.sh
CMD /startscript.sh
=====================startscript=================== /usr/sbin/init
git clone --depth 1 https://github.com/gluster/glusterfs.git cd glusterfs ./autogen.sh ./configure cd extras/LinuxRPM make glusterrpms
I think combining the update and the cleanup is useful to reduce layering:
RUN yum -y update --setopt tsflags=nodocs && yum clean all
I don't think you need libcmocka-devel perl-Test-Harness
Noted, will update the changes into the file..
I'm opening an issue as it is up for discussion - should we have the Make process part of the Dockerfile? Here's an example of the Dockerfile I've modified (inc. other modifications):