From 952ff4952d339057f43c72c76b4978db5249c5b8 Mon Sep 17 00:00:00 2001 From: Sven-Thorsten Dietrich Date: Sun, 21 Nov 2021 02:55:22 -0800 Subject: [PATCH] Add Dockerfiles for CentOS and Ubuntu - configure simple docker make targets Signed-off-by: Sven-Thorsten Dietrich --- Makefile.am | 8 ++++++++ docker/centos/Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++ docker/ubuntu/Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 docker/centos/Dockerfile create mode 100644 docker/ubuntu/Dockerfile diff --git a/Makefile.am b/Makefile.am index d1201ab..48b7fd9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,14 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} AUTOMAKE_OPTIONS = foreign SUBDIRS = src data scripts +docker-centos: + docker build -t epacts/master/centos:latest \ + -f docker/centos/Dockerfile . + +docker-ubuntu: + docker build -t epacts/master/ubuntu:latest \ + -f docker/ubuntu/Dockerfile . + install-exec-hook: mkdir --p $(libdir) R CMD INSTALL -l $(libdir) $(datadir)/${PACKAGE}/epactsR_3.3.2.tar.gz diff --git a/docker/centos/Dockerfile b/docker/centos/Dockerfile new file mode 100644 index 0000000..570761f --- /dev/null +++ b/docker/centos/Dockerfile @@ -0,0 +1,40 @@ +FROM centos:centos7 as base + +ENV EPACTS_ROOT="/opt/epacts" + +RUN yum -y install \ + centos-release-scl epel-release && \ + yum -y update && yum -y upgrade && \ + yum -y install \ + curl \ + groff \ + ghostscript \ + gnuplot \ + help2man \ + R R-studio \ + zlib + +FROM base as builder + +RUN yum -y install \ + autoconf \ + automake \ + gcc-c++ \ + libtool \ + python3 \ + python-pip \ + zlib-devel + +WORKDIR /usr/src +COPY . . + +RUN g++ --version && mkdir -p $EPACTS_ROOT && \ + autoreconf -f -i && ./configure --prefix $EPACTS_ROOT && \ + make && make install && rm -rf ${SRC_DIR} + + +FROM base as release + +ENV PATH=$EPACTS_ROOT/bin:$PATH +COPY --from=builder $EPACTS_ROOT/ $EPACTS_ROOT/ +ENTRYPOINT [ "epacts" ] diff --git a/docker/ubuntu/Dockerfile b/docker/ubuntu/Dockerfile new file mode 100644 index 0000000..ac9f98f --- /dev/null +++ b/docker/ubuntu/Dockerfile @@ -0,0 +1,42 @@ +FROM ubuntu:18.04 as base + +ENV EPACTS_ROOT="/opt/epacts" + +RUN apt -y update && apt -y upgrade && \ + DEBIAN_FRONTEND=noninteractive apt -y install --no-install-suggests \ + curl \ + groff \ + ghostscript \ + gnuplot \ + help2man \ + r-base-core \ + zlib1g + + +FROM base as builder + +RUN DEBIAN_FRONTEND=noninteractive apt -y install --no-install-suggests\ + autoconf \ + build-essential \ + g++-5 \ + libtool \ + lsb-release \ + python \ + python3-pip + +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 5 && \ + update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 5 + +WORKDIR /usr/src +COPY . . + +RUN g++ --version && mkdir -p $EPACTS_ROOT && \ + autoreconf -f -i && ./configure --prefix $EPACTS_ROOT && \ + make && make install && rm -rf ${SRC_DIR} + + +FROM base as release + +ENV PATH=$EPACTS_ROOT/bin:$PATH +COPY --from=builder $EPACTS_ROOT/ $EPACTS_ROOT/ +ENTRYPOINT [ "epacts" ]