Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embed the make process into the Dockerfile #2

Open
mykaul opened this issue Apr 13, 2021 · 4 comments
Open

embed the make process into the Dockerfile #2

mykaul opened this issue Apr 13, 2021 · 4 comments

Comments

@mykaul
Copy link
Collaborator

mykaul commented Apr 13, 2021

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):

FROM centos:8

LABEL project="centos8-gluster-build"
LABEL maintainer "[email protected]"


RUN yum -y install --setopt tsflags=nodocs --enablerepo=powertools automake autoconf libtool flex bison \
    openssl-devel libxml2-devel libaio-devel \
    readline-devel glib2-devel userspace-rcu-devel \
    libacl-devel fuse-devel redhat-rpm-config rpcgen libtirpc-devel \
    make python3-devel rsync libuuid-devel rpm-build \
    git attr libcurl-devel selinux-policy-devel firewalld liburing-devel rpcgen && yum clean all

RUN yum -y update --setopt tsflags=nodocs && yum clean all && rm -rf /var/cache/yum

#RUN yum -y install --setopt tsflags=nodocsI epel-release

#RUN yum -y install --setopt tsflags=nodocs --enablerepo=powertools rpcgen

#RUN yum clean all && rm -rf /var/cache/yum

CMD ["/usr/sbin/init"]

RUN git clone --depth 1 https://github.com/gluster/glusterfs.git
WORKDIR glusterfs
RUN ./autogen.sh
RUN ./configure
WORKDIR extras/LinuxRPM
RUN make glusterrpms
@msaju
Copy link
Collaborator

msaju commented Apr 19, 2021

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 "[email protected]"

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

@mykaul
Copy link
Collaborator Author

mykaul commented Apr 19, 2021

I think combining the update and the cleanup is useful to reduce layering:
RUN yum -y update --setopt tsflags=nodocs && yum clean all

@mykaul
Copy link
Collaborator Author

mykaul commented Apr 19, 2021

I don't think you need libcmocka-devel perl-Test-Harness

@msaju
Copy link
Collaborator

msaju commented Apr 19, 2021

Noted, will update the changes into the file..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants