Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Configuration

Docker Image

Code Block
titleCentos7
FROM centos:centos7

ARG USER_ID=1000
ARG GROUP_ID=1000
ARG ALMA_DIR=<PATH_TO_ALMA_DIR>
ARG REPO_DIR=<PATH_TO_REPOS_DIR>

#General packages
RUN yum -y install vim redhat-lsb-core sudo dbus-x11

#Install Git and Git LFS
RUN yum -y install epel-release
RUN yum -y install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
RUN yum -y install git
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | bash
RUN yum -y install git-lfs

#Install Java 11
RUN yum -y install java-11-openjdk-devel

#Prepare for Java
RUN mkdir /usr/java
RUN ln -s /usr/lib/jvm/java-openjdk /usr/java/default

#Install ACS required packages
RUN yum -y install ksh gcc gcc-c++ libX11-devel libffi-devel perl readline-devel bzip2 bzip2-devel openssl-devel openldap-devel libxml2-devel freetype-devel libxslt-devel sqlite-devel expat-devel bison flex autoconf unzip

#ARCHIVE
RUN yum -y install libtool libdb-devel

#ICD
RUN yum -y install cmake blas-devel cfitsio-devel wcslib-devel lapack-devel

#Prepare ALMASW directory#CONTROL
RUN yum -y install binutils-devel libmemcached-devel
#CORRCommon
RUN lnyum -s ${ALMA_DIR} /almay install kernel kernel-devel procmail

#TELCAL
RUN lnyum -s ${REPO_DIR} /Reposy install motif-devel texlive

#User configuration
RUN groupadd -r -g ${GROUP_ID} almamgr
RUN useradd -r -m -u ${USER_ID} -g almamgr almamgr
RUN groupadd sudo
RUN usermod -aG sudo almamgr
RUN echo test |passwd almamgr --stdin
RUN echo "%sudo ALL=(ALL)       ALL" >> /etc/sudoers
RUN echo "%sudo ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
USER almamgr

Docker Compose

Code Block
titledocker-compose.yml
version: "3.4"
services:
x-args: &args
   centos7:USER_ID: ${USER_ID}
   GROUP_ID:   args:${GROUP_ID}

x-env: &env
   - DISPLAY=${DISPLAY}

x-volumes: &volumes
   - USER_ID:${USERREPO_IDDIR}:/Repos
   - /tmp/.X11-unix:/tmp/.X11-unix:rw
     GROUP_ID:${GROUP_ID}
  - ${ALMA_DIR}/${CONTAINER_OS}:/alma
   - ./${CONTAINER_OS}/working:/working:z

x-acs-images: &common
   build:
      dockerfile: Dockerfile
      context: ./${CONTAINER_OS:centos7}
      args:
         *args
   image: acs-${CONTAINER_OS}
   environment:
      *env
   volumes:
      *volumes
   working_dir: /working

services:
   fedora26:
   volumes   <<: *common
   fedora27:
      <<: *common
  - ${REPO_DIR}:/Repos fedora28:
      <<: *common
  - $(ALMA_DIR}/${CONTAINER_OS}:/alma fedora29:
      <<: *common
  - /externalfedora30:/external
      <<: *common
   fedora31:
   - ./centos7/working:/working:z   <<: *common
   centos6:
      <<: *common
  - /tmp/.X11-unix:/tmp/.X11-unix:rw centos7:
      environment<<: *common
   centos8:
      - DISPLAY=${DISPLAY}<<: *common

Docker Compose .env

Code Block
title.env example
USER_ID=1000
GROUP_ID=1000
ALMA_DIR=/external/docker
REPO_DIR=/external/Repos
CONTAINER_OS=centos7
  • USER_ID: Id of local user executing docker instance
  • GROUP_ID: Group id from local user executing docker instance
  • ALMA_DIR: Path to <CONTAINER_OS>/almathat has all the directories that will be mounted as /alma in the container, for instance in my examples is '/external/docker/'
    • Inside this directory there's a set of directories for each OS, each having it's own alma directorywill be mounted as /alma for the different images/containers. For instance '/external/docker/centos7' will be mounted as /alma in centos7 containers.
  • REPO_DIR: Path to the Git Repository. In my case inside this path (/external/Repos) I have 'almasw' and 'worktrees', which allow to have several worktrees for building without affecting other parts of the system.