diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b520a50 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +*Dockerfile + + +README.md diff --git a/README.md b/README.md index 86361c4..d64c98d 100644 --- a/README.md +++ b/README.md @@ -58,15 +58,22 @@ git submodule update --init ### Building the docker image +#### Centos 7 ``` -docker build -t alma/acs . +docker build -t acscommunity/acs:2020.08.0-centos7-latest -t acscommunity/acs:2020.08.0-centos7 -f centos-7.Dockerfile . +``` + +#### Centos 8 + +``` +docker build -t acscommunity/acs -f centos-8.Dockerfile . ``` ## Deployment ``` -docker run --rm -it --name=acs alma/acs +docker run --rm -it --name=acs acscommunity/acs ``` If you want to compile your ACS module inside the docker container, create a docker volume that binds the path of your machine into a folder called `/test` for example: @@ -75,7 +82,7 @@ If you want to compile your ACS module inside the docker container, create a doc docker run --rm -it \ -v $PWD:/test \ -w /test \ - alma/acs + acscommunity/acs ``` If you need to receive the graphical interface from the container: @@ -87,7 +94,7 @@ docker run --rm -it \ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ -v $PWD:/test \ -w /test \ - alma/acs + acscommunity/acs ``` ## Contributing diff --git a/centos-7.Dockerfile b/centos-7.Dockerfile new file mode 100644 index 0000000..14c21b0 --- /dev/null +++ b/centos-7.Dockerfile @@ -0,0 +1,103 @@ +FROM centos:7 AS base + +ENV ACS_PREFIX=/alma ACS_TAG="2020AUG" ACS_VERSION="2020.8" + +ENV ACS_ROOT="${ACS_PREFIX}/ACS-${ACS_TAG}" + +ENV JAVA_HOME="/usr/java/default" + +# The package list below is alphabetically sorted, so not sorted by importance. +# It may very well be, that noe all packages are actually needed. +# If you studied this, and found out we can shorten this list without loosing +# the ability to execute all the ACS examples, we'd be happy to hear from you +# either by opening an issue, or by you immediately fixing this and opening a +# pull request. +RUN yum install -y \ + bison \ + bzip2 \ + bzip2-devel \ + dos2unix \ + epel-release \ + expat-devel \ + file \ + flex \ + freetype-devel \ + gcc \ + gcc-c++ \ + gcc-gfortran \ + git \ + java-11-openjdk \ + java-11-openjdk-devel \ + libffi \ + libffi-devel \ + libX11-devel \ + libxml2-devel \ + libxslt-devel \ + make \ + net-tools \ + openldap-devel \ + openssl-devel \ + perl \ + procmail \ + python2-pip \ + python3-pip \ + readline-devel \ + redhat-lsb-core \ + rpm-build \ + sqlite-devel \ + tcl-devel \ + tk-devel \ + xauth && \ + yum clean all && \ + # Prepare Java + mkdir -pv /usr/java && \ + ln -sv /usr/lib/jvm/java-openjdk $JAVA_HOME && \ + echo "source $ACS_ROOT/ACSSW/config/.acs/.bash_profile.acs" >> /etc/bashrc + +# ============= Compiler Stage =============================================== +FROM base AS dependency_builder + +COPY acs/ /acs + +COPY acs-patches/ /tmp +RUN yum -y install autoconf \ + curl \ + git-lfs \ + ksh \ + mc \ + nc \ + patch \ + # Needed by buildJacOrb + rsync \ + screen \ + subversion \ + tree \ + unzip \ + vim \ + wget \ + xterm && \ + cd /acs/ExtProd/PRODUCTS && \ + # some versions for python dependencies have changed. + # Also we removed the *bulkDataNT* and *bulkData* modules from the Makefile + # as we don't have the properietary version of DDS and don't use this modules. + sed -i 's/bulkDataNT bulkData //g' /acs/Makefile && \ + cd /acs/ExtProd/INSTALL && \ + patch -p1 -d /acs < /tmp/python-module-installation.patch && \ + source /acs/LGPL/acsBUILD/config/.acs/.bash_profile.acs && \ + time MAKE_NOSTATIC=1 OPTIMIZE=3 make -C /acs/ExtProd/INSTALL all && \ + find /alma -name "*.o" -exec rm -v {} \; +# --------------------- Here external dependencies are built -------------- + +FROM dependency_builder as acs_builder + +RUN cd /acs/ && \ + source /acs/LGPL/acsBUILD/config/.acs/.bash_profile.acs && \ + time MAKE_NOSTATIC=1 OPTIMIZE=3 MAKE_PARS="-j $(nproc)" make build && \ + find $ACS_ROOT -name "*.o" -exec rm {} \; && \ + find $ACS_ROOT -type f -executable |grep -v "/pyenv/" | xargs file | grep ELF | awk '{print $1}' | tr -d ':' | xargs strip --strip-unneeded +# ============= Target image stage =========================================== +FROM base + +WORKDIR / + +COPY --from=acs_builder /alma /alma diff --git a/Dockerfile b/centos-8.Dockerfile similarity index 100% rename from Dockerfile rename to centos-8.Dockerfile